aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Style fixes"Pratik Naik2010-07-151-20/+20
| | | | This reverts commit 3c300b31219f2af3ecd46ef22b04e5c5548db899.
* Style fixeswycats2010-07-141-20/+20
|
* Style fixesPratik Naik2010-07-141-20/+20
|
* Fix the #using_limitable_reflections? helper to work correctly by not ↵Ken Collins2010-07-081-1/+1
| | | | | | examining the length of an array which contains false/true, hence always passing. [#4869 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* No need to check if the attribute exists (this is the same behavior as in ↵José Valim2010-06-291-3/+1
| | | | 2.3) [#4994 state:resolved] and [#5003 state:resolved]
* array subtraction should be faster than iterating over all the elementsNeeraj Singh2010-06-291-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Add scoping and unscoped as the syntax to replace the old with_scope and ↵José Valim2010-06-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove unneeded rejectSantiago Pastorino2010-06-281-8/+1
|
* Refactor: metaprogramming here it's confusing and make use of tapSantiago Pastorino2010-06-261-64/+73
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Removes useless flattenSantiago Pastorino2010-06-261-4/+9
|
* Create a little bit less objects in ARel.José Valim2010-06-261-6/+9
|
* blocks removed from all the ActiveRelation query_methods, extend method ↵Santiago Pastorino2010-06-261-8/+4
| | | | | | added instead Signed-off-by: José Valim <jose.valim@gmail.com>
* reorder method added to ActiveRelationSantiago Pastorino2010-06-261-0/+8
| | | | | | [#4972 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* Support for multiple selects addedNeeraj Singh and Santiago Pastorino2010-06-251-4/+7
| | | | [#4841 state:committed]
* Makes a build_select for the select part of build_arelSantiago Pastorino2010-06-251-10/+13
|
* Metaprogramming not needed hereSantiago Pastorino2010-06-251-11/+9
|
* Only yield block if given.Emilio Tagua2010-06-241-2/+2
|
* Remove block definitions in finder methods.Emilio Tagua2010-06-241-4/+4
|
* Fix small bug where ActiveRecord::PredicateBuilder#build_from_hash didn't ↵James Harton2010-06-221-1/+1
| | | | | | test for Arel::Relation as right hand value. [#4917 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix order method to accept relation attributes.Emilio Tagua2010-06-221-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Don't waste time building relations if there are no values presents. [#4860 ↵Emilio Tagua2010-06-211-4/+4
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Refactor build_arel: move joins out and simplify havings. [#4860 state:resolved]Emilio Tagua2010-06-201-46/+46
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Special treatement for Relation#select { with block }Pratik Naik2010-06-021-1/+14
|
* To allow proper fisting of stack traceSantiago Pastorino2010-05-141-3/+3
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* revises the rdoc of #average according to 5f3bd55, and realigns when clausesXavier Noria2010-05-121-5/+4
|
* type_cast_calculated_value refactor: value is never a Fixnum here. Fix test ↵Santiago Pastorino2010-05-111-1/+1
| | | | | | | | since SQLite returns Float. [#4514 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Improve code from 231d7676f72947bae765b9bd885b134aaf949921Pratik Naik2010-05-091-7/+5
|
* corrected AR find_each and find_in_batches to raise when the user uses ↵Josh Kalderimis2010-05-091-1/+8
| | | | | | select but does not specify the primary key Signed-off-by: José Valim <jose.valim@gmail.com>
* Here the intention was to assign to different objectsSantiago Pastorino2010-05-081-1/+1
|
* Make find_or_create and find_or_initialize work mixing explicit parameters ↵Santiago Pastorino2010-05-071-9/+13
| | | | | | and a hash [#4457 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix unintuitive behavior with multiple order and group clausesErnie Miller2010-05-063-8/+9
| | | | | | [#4545 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Allow pre-casted values (other than nil) to pass through from calculations ↵Brian Lopez2010-05-041-5/+9
| | | | | | | | un-touched [#4514 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix eager loading of associations causing table name collisionsErnie Miller2010-04-282-32/+42
| | | | | | [#4463 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Some require indifferent_access addedSantiago Pastorino2010-04-211-0/+1
| | | | Signed-off-by: Xavier Noria <fxn@ubuntu.(none)>
* Build PredicateBuilder object only when neededPratik Naik2010-04-211-3/+1
|
* Fix evals missing contextJeremy Kemper2010-04-101-3/+3
|
* Avoid deprecated String#to_a by using Array.wrap(...) instead of Array(...)Jeremy Kemper2010-04-101-1/+2
|
* Raise a StatementInvalid error when trying to build a condition with hash ↵Carl Lerche2010-04-031-1/+3
| | | | keys that do not correspond to columns.
* Goodbye ActiveRecord::NamedScope::ScopePratik Naik2010-04-021-1/+1
|
* Make Relation#first and Relation#last behave like named scope'sPratik Naik2010-04-021-2/+18
|
* Add Relation extensionsPratik Naik2010-04-022-8/+28
|
* Consistency when using Relation constantsPratik Naik2010-04-021-2/+2
|
* Arel now handles ranges with excluded end.Emilio Tagua2010-03-291-6/+1
|
* Warn scoped order and limit are ignored. [#4123 state:resolved]Emilio Tagua2010-03-291-1/+5
|
* adds missing requires for Object#blank? and Object#present?Xavier Noria2010-03-285-0/+10
|
* Move methods from association to relation finder methods.Emilio Tagua2010-03-251-2/+11
|
* Refactor relation merging to create just one relation and then assign ↵Emilio Tagua2010-03-251-22/+14
| | | | values, instead of creating multiple relation objects.
* From and lock should be defined to be consistent with other ivars. Limit and ↵Emilio Tagua2010-03-221-14/+4
| | | | | | | | offset are always defined, no need to test that. [#4253 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* kill where / having method redefine warnings. [#4225 state:resolved]Aaron Patterson2010-03-181-0/+1
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Arel now fallback to using Arel::Attribute if the table/column doesn't exists.Emilio Tagua2010-03-101-3/+1
| | | | | | [#4142 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>