Commit Graph

5880 Commits

Author SHA1 Message Date
Jon Leighton
72a4893452 Merge pull request #451 from baroquebobcat/fixing_last_for_issue_371 2011-05-08 23:43:34 +01:00
Nick Howard
92c10760d7 Fix for #371
if a query contains a limit or an offset, ActiveRecord::FinderMethods#find_last had inconsistent behavior.

If the records were loaded, it returned the last record in the cached list.
If they were not, it reversed the order of the query and changed the limit to one.
If the earlier limit was less than the total matching the query in the db,
it would return a different record than if the records had been cached.

This commit changes find_last so that it loads the records when getting the
last record on a query containing a limit or an offset, which makes the behavior consistent.
2011-05-08 23:42:53 +01:00
Jon Leighton
8f10ccd311 Ensure that ORDER BY clauses from default scopes are not included in calculation queries. Fixes #406. 2011-05-08 23:31:16 +01:00
Christopher Meiklejohn
4fbd8adf48 Don't quote ID's as Arel will quote them -- follow same conventions as the delete method. 2011-05-08 18:37:28 +01:00
Josh Kalderimis
b2451f4a7f renamed mass-assignment scopes to roles, updated code, tests, docs and security guide 2011-05-08 16:43:29 +02:00
Jason Noble
e5c18ff2cc Added deprecation warning for Fixture(s) (Use ActiveRecord::Fixture(s)) 2011-05-07 16:15:09 -06:00
Jason Noble
7db2ef47a1 Namespace Fixtures in ActiveRecord
[Fixes #439]
2011-05-07 14:20:51 -06:00
José Valim
ba23bf43f2 Class.new.name returns an empty string on 1.8 2011-05-07 17:46:44 +02:00
José Valim
5d6c8d5e9d Revert "Revert the merge because tests did not pass."
This reverts commit 886818d2ba.
2011-05-07 17:33:40 +02:00
Hemant Kumar
20c35bca5a fix yield not working from around filter of observers, fixes Github#329 2011-05-07 03:03:41 +05:30
Xavier Noria
29dbccff30 Merge pull request #396 from asanghi/lh_4346
Multiparameter POLA (principle of least authority) with respect to time_select fixes. See LH4346
2011-05-06 03:53:17 -07:00
José Valim
41a6d96c1b Update CHANGELOGs. 2011-05-06 05:53:58 +02:00
Jon Leighton
030e1d06ca Merge pull request #399 from ernie/join_conditions_on_join
Add association join conditions to JOIN clause, not WHERE
2011-05-05 13:23:15 -07:00
Ernie Miller
9b7cd75db3 Add a test for outer joins with conditions where value IS NULL 2011-05-05 14:34:48 -04:00
Aaron Patterson
f098c80947 Merge pull request #358 from baroquebobcat/fix_find_or_create_master
Fix for lighthouse #6741
2011-05-05 11:13:05 -07:00
Ernie Miller
8d270a2abb Add join conditions to JOIN clause, not WHERE 2011-05-05 12:35:29 -04:00
Aditya Sanghi
7d0f26796d Multiparameter POLA, time_select fixes. See LH4346 2011-05-05 15:41:14 +05:30
David Heinemeier Hansson
169ae75e09 Prepare for beta1 2011-05-04 20:21:05 -05:00
Aaron Patterson
38d92d705e ensure query cache is cleared when Rack body is closed, fixes bug reported on 951e18abea 2011-05-04 15:24:26 -07:00
Santiago Pastorino
bd4831d699 Bump up rack-cache, tzinfo and thor 2011-05-04 16:47:48 -03:00
José Valim
92661b0c50 Move sandbox to AR and pass the sandbox as a value. This way, other ORMs like Datamapper can also have their own sandboxing in rails console. 2011-05-04 16:47:35 +02:00
José Valim
b9bba555ca Remove defined?(ActiveRecord) and use the railtie hook instead. 2011-05-04 16:32:24 +02:00
Xavier Noria
cea3b3cc9d Merge branch 'master' of git://github.com/lifo/docrails 2011-05-04 14:51:04 +02:00
Sebastian Martinez
24586edae2 Remove extra whitespaces 2011-05-03 21:38:19 -03:00
Sebastian Martinez
0ee2513356 Improves Mysql2 adapter docs 2011-05-03 21:26:02 -03:00
Sebastian Martinez
fab9bb77bf Added #recreate_database docs 2011-05-03 21:25:38 -03:00
Sebastian Martinez
f049062497 Fixes on schema_definitions docs 2011-05-03 21:11:17 -03:00
Josh Kalderimis
323b7585e1 added the mysql schema test to mysql2 adapter, and fixed the corresponding failures 2011-05-03 21:15:10 +02:00
Aaron Patterson
cb9557c432 make sure IM repository is cleared after body is closed 2011-05-03 09:59:22 -07:00
Aaron Patterson
d0719c5938 proxying the body in the IM middleware so that IM is available for streaming ERb 2011-05-03 09:59:22 -07:00
Aaron Patterson
3f897c1a4c adding a test case for the identity map middleware 2011-05-03 09:59:21 -07:00
Sebastian Martinez
d53c2e4952 fixed-fonts on SchemaDefinitions 2011-05-02 20:30:31 -03:00
Josh Kalderimis
b5824a4d04 favor collect over each in mysql* adapters 2011-05-03 00:33:39 +02:00
Aaron Patterson
951e18abea introduce a body proxy to ensure that query cache is enabled during streaming 2011-05-02 11:30:49 -07:00
Aaron Patterson
4300855e7d more tests around caching 2011-05-02 11:17:31 -07:00
Aaron Patterson
3066ea8b44 add a couple test cases surrounding query cache middleware 2011-05-02 11:13:49 -07:00
Sebastian Martinez
04d37b077b Remove extra whitespaces 2011-05-02 10:37:34 -03:00
José Valim
3fc37e8ef9 Fix failing AR test. 2011-05-02 10:16:13 +02:00
David Heinemeier Hansson
31155eeb3c Make the identity map use the instrumentation infrastructure so we can style the messages nicely with colors (FIXME: Can someone look into why the test is not working?) 2011-05-01 19:10:21 -06:00
David Heinemeier Hansson
635abc7194 Remove schema noise from logging (TODO: Deprecate/remove the name attribute to all these methods -- will take a pull request!) 2011-05-01 18:22:43 -06:00
David Heinemeier Hansson
a8861c8f5b Merge pull request #357 from joshk/assign_attributes.
Assign protected attributes with create/new and control the role.
2011-05-01 16:59:33 -07:00
David Heinemeier Hansson
32ef3ccaa6 Merge pull request #340 from joshk/default_scope_changes.
removed the default_scope deprecations and updated the docs and tests to
2011-05-01 16:54:36 -07:00
Nick Howard
86ea94e4d0 Fix for lighthouse #6741
- adds tests for find_or_create_by and find_or_initialize_by on has_many associations
- changes the behavior of ActiveRecord::Associations::CollectionProxy#method_missing to differ to
  ActiveRecord::FinderMethods#find_or_instantiator_by_attributes for arg processing and saving so
  find_or_create_by's api on associations will be consistent w/ the api for model classes.
2011-05-01 16:22:56 -06:00
Josh Kalderimis
86d7ed3375 singular and collection relations in AR can now specify mass-assignment security options (:as and :without_protection) in build, create and create! methods. 2011-05-01 23:30:07 +02:00
Josh Kalderimis
7c5ae0a88f Added mass-assignment security :as and :without_protection support to AR.new and AR.create 2011-05-01 23:08:50 +02:00
Aaron Patterson
23eb81a3d1 assert_difference can take a callable piece of code rather than just evaling a string 2011-05-01 11:55:13 -07:00
Aaron Patterson
1800a6d1c8 Merge pull request #316 from arunagw/jdbc_postgresql.
Re-factored database.rake to allow Jdbcpostgresql. #jruby
2011-05-01 10:53:41 -07:00
Xavier Noria
2fbf302149 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	railties/guides/source/contributing_to_ruby_on_rails.textile
2011-05-01 11:16:31 +02:00
Aaron Patterson
a0656989c4 fixing more test warnings in 1.9.3 2011-04-30 17:40:53 -07:00
Aaron Patterson
9274a5744b fixing test warnings 2011-04-30 17:37:58 -07:00