aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/car.rb
Commit message (Collapse)AuthorAgeFilesLines
* Test polymorphic record with optimistic locking and counter cache should be ↵Dmitry Polushkin2011-09-091-1/+1
| | | | destoyed without catching the ActiveRecord::StaleObjectError.
* Ensure we are not comparing a string with a symbol in ↵Jon Leighton2011-09-061-1/+1
| | | | HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be.
* Don't use mass-assignment protection when setting foreign keys or ↵Jon Leighton2011-05-121-0/+3
| | | | association conditions on singular associations. Fixes #481 (again).
* Add test to specify that attributes from an association's conditions should ↵Jon Leighton2011-05-101-0/+2
| | | | be assigned without mass-assignment protection when a record is built on the association.
* Un-deprecate using 'default_scope' as a macro, but if you are calling the ↵Jon Leighton2011-04-181-6/+2
| | | | macro multiple times that will give deprecation warnings, and in 3.2 we will simply overwrite the default scope when you call the macro multiple times.
* Deprecated support for passing hashes and relations to default_scope, in ↵Jon Leighton2011-04-121-2/+7
| | | | favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details.
* expanding the test to include both type of order declarationNeeraj Singh2010-09-181-2/+9
| | | | | | | | | while declaring default_scope Also added test for unscoped using block style with four different combinations Signed-off-by: José Valim <jose.valim@gmail.com>
* order should always be concatenated.Neeraj Singh2010-09-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | order that is declared first has highest priority in all cases. Here are some examples. Car.order('name desc').find(:first, :order => 'id').name Car.named_scope_with_order.named_scope_with_another_order Car.order('id DESC').scoping do Car.find(:first, :order => 'id asc') end No special treatment to with_scope or scoping. Also note that if default_scope declares an order then the order declared in default_scope has the highest priority unless with_exclusive_scope is used. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* While creating a new record using has_many create method default scope of ↵Neeraj Singh2010-08-191-0/+1
| | | | | | | | | | | child should be respected. author.posts.create should take into account default_scope defined on post. [#3939: state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Ensure we can nest include calls [#5285 state:resolved]Neeraj Singh2010-08-121-0/+5
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* reset_counter should work with non-traditional belongs_to and polymorphic ↵Neeraj Singh2010-07-081-0/+4
belongs_to [#4984 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>