Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | ActiveRecord::Relation#primary_key should return a string, just like ↵ | Jon Leighton | 2011-01-03 | 1 | -0/+4 |
| | | | | ActiveRecord::Base.primary_key does. | ||||
* | Let AssociationCollection#find use #scoped to do its finding. Note that I am ↵ | Jon Leighton | 2011-01-03 | 1 | -0/+4 |
| | | | | removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences. | ||||
* | Fix test_any in relations_test.rb, which was failing when relations_test.rb ↵ | Jon Leighton | 2011-01-03 | 1 | -0/+8 |
| | | | | is run on its own (it passes when the entire suite is run). This is a hacky fix for a problem I didn't quite get to the bottom of, so I'd welcome a better solution... | ||||
* | Added one more failing test for bug #6036 | Robert Pankowecki (Gavdi) | 2011-01-04 | 1 | -0/+6 |
| | |||||
* | ActiveRecord::Base.joins should allow single nil argument [#6181 state:resolved] | Piotr Sarnacki | 2010-12-16 | 1 | -0/+4 |
| | |||||
* | Replace rudimentary named_scope with scope. [#6052 state:resolved] | Pavel Gorbokon | 2010-12-15 | 1 | -3/+3 |
| | | | | | | | * rename method names (actually in tests) * rename instance variable @_named_scopes_cache to @_scopes_cache * rename references in doc comments * don't touch CHANGELOG :) | ||||
* | Do not send id for quoting twice if the primary key is string. | Neeraj Singh | 2010-11-23 | 1 | -1/+8 |
| | | | | [#6022 state:resolved] | ||||
* | testing multiple ORd queries | Aaron Patterson | 2010-11-18 | 1 | -0/+12 |
| | |||||
* | When use where more than once on the same column, relation doesn't do an ↵ | Santiago Pastorino | 2010-11-17 | 1 | -0/+9 |
| | | | | 'or' or 'in' with the values | ||||
* | support finding by a ruby class [#5979 state:resolved] | Aaron Patterson | 2010-11-15 | 1 | -0/+7 |
| | |||||
* | adding more test coverage around finding with active record objects | Aaron Patterson | 2010-11-15 | 1 | -0/+12 |
| | |||||
* | use quoted id of single AR::Base objects in predicates | Aaron Patterson | 2010-11-15 | 1 | -0/+6 |
| | |||||
* | use persisted? instead of new_record? wherever possible | David Chelimsky | 2010-11-09 | 1 | -5/+5 |
| | | | | | | | | | | | - persisted? is the API defined in ActiveModel - makes it easier for extension libraries to conform to ActiveModel APIs without concern for whether the extended object is specifically ActiveRecord [#5927 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | use column names as order by complex function parameters, fix for postgresql ↵ | Raimonds Simanovskis | 2010-11-07 | 1 | -12/+2 |
| | | | | | | adapter to correctly remove ASC/DESC Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | Fixes queries using limits and punctuation in order, removes order("col1, ↵ | Santiago Pastorino | 2010-11-05 | 1 | -1/+22 |
| | | | | | | col2") usage in favor of order(["col1", "col2"}) [#4597 state:committed] | ||||
* | adding tests for #5234 and #5184. Tests were from Akira Matsuda. Thanks Akira! | Aaron Patterson | 2010-10-30 | 1 | -0/+5 |
| | |||||
* | adding bind_values to relations | Aaron Patterson | 2010-10-26 | 1 | -0/+9 |
| | |||||
* | removing call to deprecated API, this test is outside AR responsibilities | Aaron Patterson | 2010-10-22 | 1 | -7/+0 |
| | |||||
* | reorder removed in favor of except(:order).order | Santiago Pastorino | 2010-10-11 | 1 | -6/+0 |
| | |||||
* | @klass also uses DynamicFinderMatch, so no need for it on the relation | Aaron Patterson | 2010-09-27 | 1 | -0/+5 |
| | |||||
* | expanding the test to include both type of order declaration | Neeraj Singh | 2010-09-18 | 1 | -6/+22 |
| | | | | | | | | | 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> | ||||
* | removing nonsensical tests, limit now actually adds a limit | Aaron Patterson | 2010-09-15 | 1 | -4/+0 |
| | |||||
* | added a test for relation which checks intersection between a relation and ↵ | kane | 2010-09-10 | 1 | -0/+6 |
| | | | | | | an array works in both directions Signed-off-by: Mikel Lindsaar <raasdnil@gmail.com> | ||||
* | Add tests for Relation#only. | Emilio Tagua | 2010-09-09 | 1 | -0/+11 |
| | |||||
* | select should raise error when no block or no parameter is passed | Aaron Patterson | 2010-09-07 | 1 | -0/+4 |
| | |||||
* | order should always be concatenated. | Neeraj Singh | 2010-09-05 | 1 | -0/+18 |
| | | | | | | | | | | | | | | | | | | | | | | 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> | ||||
* | Fix test: this should return 0 not 7, since Arel was ignoring select clause ↵ | Emilio Tagua | 2010-09-01 | 1 | -1/+1 |
| | | | | | | and now it's fixed. Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | code gardening: we have assert_(nil|blank|present), more concise, with ↵ | Xavier Noria | 2010-08-17 | 1 | -2/+2 |
| | | | | better default failure messages - let's use them | ||||
* | Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵ | Santiago Pastorino | 2010-08-14 | 1 | -2/+2 |
| | | | | 's/[ \t]*$//' -i {} \;) | ||||
* | Ensure we can nest include calls [#5285 state:resolved] | Neeraj Singh | 2010-08-12 | 1 | -1/+11 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | test to ensure that respond_to? delegates to arel | Aaron Patterson | 2010-08-06 | 1 | -0/+19 |
| | |||||
* | sorry AR, my privates are none of your business | Aaron Patterson | 2010-08-06 | 1 | -7/+0 |
| | |||||
* | reverting where() functionality, adding a test | Aaron Patterson | 2010-07-30 | 1 | -0/+5 |
| | |||||
* | removing unused models from tests | Subba Rao Pasupuleti | 2010-07-21 | 1 | -1/+0 |
| | | | | | | [#5153 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Add scoping and unscoped as the syntax to replace the old with_scope and ↵ | José Valim | 2010-06-29 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with_exclusive_scope. A few examples: * with_scope now should be scoping: Before: Comment.with_scope(:find => { :conditions => { :post_id => 1 } }) do Comment.first #=> SELECT * FROM comments WHERE post_id = 1 end After: Comment.where(:post_id => 1).scoping do Comment.first #=> SELECT * FROM comments WHERE post_id = 1 end * with_exclusive_scope now should be unscoped: class Post < ActiveRecord::Base default_scope :published => true end Post.all #=> SELECT * FROM posts WHERE published = true Before: Post.with_exclusive_scope do Post.all #=> SELECT * FROM posts end After: Post.unscoped do Post.all #=> SELECT * FROM posts end Notice you can also use unscoped without a block and it will return an anonymous scope with default_scope values: Post.unscoped.all #=> SELECT * FROM posts | ||||
* | blocks removed from all the ActiveRelation query_methods, extend method ↵ | Santiago Pastorino | 2010-06-26 | 1 | -1/+1 |
| | | | | | | added instead Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | reorder method added to ActiveRelation | Santiago Pastorino | 2010-06-26 | 1 | -0/+6 |
| | | | | | | [#4972 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Test for concatenated orders added | Santiago Pastorino | 2010-06-26 | 1 | -0/+6 |
| | | | | | | [#4972] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Support for multiple selects added | Neeraj Singh and Santiago Pastorino | 2010-06-25 | 1 | -0/+6 |
| | | | | [#4841 state:committed] | ||||
* | Add tests for relation count. Fix other tests that were conceptually wrong. | Emilio Tagua | 2010-06-24 | 1 | -1/+5 |
| | | | | | | [#4882 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | adding fix for to_xml for ActiveRecord relation object | Neeraj Singh | 2010-06-23 | 1 | -0/+5 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | ActiveRecord's relation object should respond to to_json and to_yaml | Neeraj Singh | 2010-06-23 | 1 | -0/+10 |
| | | | | | | [#4547 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | test for #4917 | Neeraj Singh | 2010-06-22 | 1 | -0/+7 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Fix order method to accept relation attributes. | Emilio Tagua | 2010-06-22 | 1 | -2/+6 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | This test shouldn't rely on the order of the data returned by select | Santiago Pastorino | 2010-06-07 | 1 | -1/+1 |
| | | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | ||||
* | Special treatement for Relation#select { with block } | Pratik Naik | 2010-06-02 | 1 | -0/+5 |
| | |||||
* | Final iteration of use better testing methods | Neeraj Singh | 2010-05-19 | 1 | -3/+3 |
| | | | | | | [#4652 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Add Relation extensions | Pratik Naik | 2010-04-02 | 1 | -0/+16 |
| | |||||
* | Relation should respond to class methods | Pratik Naik | 2010-01-22 | 1 | -0/+5 |
| | |||||
* | Handle invalid query IN() generated when a blank array is supplied in hash ↵ | Pratik Naik | 2010-01-18 | 1 | -0/+5 |
| | | | | conditions |