Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Relation#from to accept other Relation objects | Radoslav Stankov | 2012-05-17 | 1 | -5/+29 |
| | | | | Record.from("(#{sub_query.to_sql})") -> Record.from(sub_query) Record.from("(#{sub_query.to_sql}) a") -> Record.from(sub_query, :a) | ||||
* | CollectionProxy < Relation | Jon Leighton | 2012-05-11 | 1 | -21/+21 |
| | | | | | | | | | | | | | | | | | | | | | This helps bring the interfaces of CollectionProxy and Relation closer together, and reduces the delegation backflips we need to perform. For example, first_or_create is defined thus: class ActiveRecord::Relation def first_or_create(...) first || create(...) end end If CollectionProxy < Relation, then post.comments.first_or_create will hit the association's #create method which will actually add the new record to the association, just as post.comments.create would. With the previous delegation, post.comments.first_or_create expands to post.comments.scoped.first_or_create, where post.comments.scoped has no knowledge of the association. | ||||
* | use a hash to store relation values | Jon Leighton | 2012-04-13 | 1 | -18/+43 |
| | |||||
* | doesn't make sense for select! to take a block | Jon Leighton | 2012-04-13 | 1 | -8/+3 |
| | |||||
* | remove apply_finder_options call from AssociationScope | Jon Leighton | 2012-04-13 | 1 | -1/+1 |
| | |||||
* | Make Relation#extending work like other value methods | Jon Leighton | 2012-04-13 | 1 | -9/+6 |
| | |||||
* | Add bang versions of relation query methods. | Jon Leighton | 2012-04-12 | 1 | -84/+135 |
| | | | | | The main reason for this is that I want to separate the code that does the mutating from the code that does the cloning. | ||||
* | fix activerecord query_method regression with offset into Fixnum | Denis Jean | 2012-03-12 | 1 | -1/+1 |
| | | | | | | add test to show offset query_methods on mysql & mysql2 change test to cover public API | ||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-02-09 | 1 | -2/+2 |
|\ | | | | | | | | | Conflicts: activerecord/lib/active_record/relation/query_methods.rb | ||||
| * | use appropriate words for docs of Model.none | Rohit Arondekar | 2012-02-07 | 1 | -2/+2 |
| | | |||||
| * | minor tidy up of none relation query method | Rohit Arondekar | 2012-02-06 | 1 | -2/+2 |
| | | |||||
| * | Fix code example in ActiveRecord::Relation#none | Carlos Antonio da Silva | 2012-02-01 | 1 | -3/+3 |
| | | |||||
* | | document the AR none method [ci skip] | Vijay Dev | 2012-02-01 | 1 | -7/+7 |
|/ | |||||
* | Added `none` query method to return zero records. | Juanjo Bazán | 2012-01-31 | 1 | -0/+33 |
| | | | And added NullRelation class implementing the null object pattern for the `Relation` class. | ||||
* | select doesn't take multiple arguments - fixes #4539 [ci skip] | Vijay Dev | 2012-01-19 | 1 | -5/+5 |
| | | | | | Also, fixed the bit about returning AM::MissingAttributeError. This seems to be fixed earlier in 3-2-stable only. | ||||
* | infer references from Relation#order | Jon Leighton | 2012-01-16 | 1 | -1/+7 |
| | |||||
* | store references as a string | Jon Leighton | 2012-01-16 | 1 | -1/+1 |
| | |||||
* | automatically add references when we can | Jon Leighton | 2012-01-16 | 1 | -1/+3 |
| | |||||
* | Add ActiveRecord::Relation#references (#950) | Jon Leighton | 2012-01-16 | 1 | -1/+19 |
| | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-01-11 | 1 | -0/+10 |
|\ | |||||
| * | add documentation explaining reorder behavior | Matt Jones | 2012-01-09 | 1 | -0/+10 |
| | | |||||
* | | correctly handle order calls after a reorder | Matt Jones + Scott Walker | 2012-01-03 | 1 | -3/+4 |
|/ | |||||
* | Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query | Jon Leighton | 2011-11-05 | 1 | -6/+24 |
| | |||||
* | copy edits 908f2616 | Vijay Dev | 2011-09-20 | 1 | -4/+4 |
| | |||||
* | Document ActiveRecord::QueryMethods#select | Ryan Bigg | 2011-09-17 | 1 | -0/+29 |
| | |||||
* | minor edit | Vijay Dev | 2011-09-14 | 1 | -1/+1 |
| | |||||
* | Add documentation for the extending method in ActiveRecord:QueryMethods | Ryan Bigg | 2011-09-14 | 1 | -0/+36 |
| | |||||
* | Revert "Fixes bug in ActiveRecord::QueryMethods, #1697" | Jon Leighton | 2011-09-04 | 1 | -2/+4 |
| | | | | | | This reverts commit 0df27c98d982ec87d2fb48cfda82694eb267993e. Reverted due to failing test, see #2845. | ||||
* | Fixes bug in ActiveRecord::QueryMethods, #1697 | Joshua Wehner | 2011-08-31 | 1 | -4/+2 |
| | | | Replace split on comma with a regexp that will reverse all ASC/DESC specifically | ||||
* | The join_nodes must be passed to the JoinDependency initializer and ↵ | Jon Leighton | 2011-08-29 | 1 | -7/+2 |
| | | | | therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556. | ||||
* | Revert "Merge pull request #2309 from smasry/master" | Jon Leighton | 2011-07-28 | 1 | -1/+1 |
| | | | | | | | This reverts commit 9d396ee8195e31f646e0b89158ed96f4db4ab38f, reversing changes made to fa2bfd832c1d1e997d93c2269a485cc74782c86d. Reason: the change broke the build. | ||||
* | Reverse order fix when using function for ActiveRecord::QueryMethods Fixes #1697 | Samer Masry | 2011-07-27 | 1 | -1/+1 |
| | |||||
* | Revert "allow select to have multiple arguments" | Piotr Sarnacki | 2011-07-26 | 1 | -6/+3 |
| | | | | | | | This reverts commit 04cc446d178653d362510e79a22db5300d463161. I reverted it because apparently we want to use: select([:a, :b]) instead of select(:a, :b), but there was no tests for that form. | ||||
* | allow select to have multiple arguments | Sławosz Sławiński | 2011-07-26 | 1 | -3/+6 |
| | |||||
* | Ordering with extra spaces was raising a SQL exception | Franck Verrot | 2011-07-24 | 1 | -0/+1 |
| | |||||
* | fix AR having() not to raise NoMethodError when the given argument does not ↵ | Akira Matsuda | 2011-07-09 | 1 | -3/+3 |
| | | | | | | respond to empty? having raises NoMethodError: undefined method `empty?' when a Fixnum or Date/Time were passed via varargs | ||||
* | Remove case statement changes from 2e0840d and 56ac32a. Inheritance FTW. | Ernie Miller | 2011-07-06 | 1 | -1/+1 |
| | |||||
* | Fix case | Oriol Gual | 2011-06-28 | 1 | -2/+1 |
| | |||||
* | Update reverse order with new Arel Nodes | Oriol Gual | 2011-06-28 | 1 | -1/+2 |
| | |||||
* | default create_with_value to a hash so we can eliminate conditionals, add ↵ | Aaron Patterson | 2011-06-27 | 1 | -1/+1 |
| | | | | test surrounding create_with(nil) behavior | ||||
* | Support reversal of ARel orderings in reverse_sql_order | Ernie Miller | 2011-06-20 | 1 | -3/+12 |
| | |||||
* | Fix issue #1272 | Brian Mathiyakom | 2011-06-01 | 1 | -8/+7 |
| | | | | | Set reverse_order_value when asked to reverse_order(). Do the actual reversal in build_arel. | ||||
* | Evaluate default scopes at the last possible moment in order to avoid ↵ | Jon Leighton | 2011-04-12 | 1 | -4/+10 |
| | | | | problems with default scopes getting included into other scopes and then being unable to remove the default part via unscoped. | ||||
* | Bring #reorder back | Sebastian Martinez | 2011-03-28 | 1 | -0/+4 |
| | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | Resolve some TODO comments which I decided did not need anything done | Jon Leighton | 2011-03-12 | 1 | -1/+0 |
| | |||||
* | Merge branch 'master' into nested_has_many_through | Jon Leighton | 2011-03-04 | 1 | -37/+41 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb | ||||
| * | Move JoinDependency and friends from ↵ | Jon Leighton | 2011-02-28 | 1 | -2/+2 |
| | | | | | | | | ActiveRecord::Associations::ClassMethods to just ActiveRecord::Associations | ||||
| * | use an attribute rather than a SQL literal | Aaron Patterson | 2011-02-26 | 1 | -1/+1 |
| | | |||||
| * | explicitly allowing lolqueries | Aaron Patterson | 2011-02-16 | 1 | -10/+1 |
| | | |||||
| * | limit() should sanitize limit values | Aaron Patterson | 2011-02-08 | 1 | -1/+1 |
| | | | | | | | | This fixes CVE-2011-0448 |