aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* 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>
* Fix unintuitive behavior with multiple order and group clausesErnie Miller2010-05-061-6/+2
| | | | | | [#4545 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix eager loading of associations causing table name collisionsErnie Miller2010-04-281-31/+42
| | | | | | [#4463 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* 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
|
* Add Relation extensionsPratik Naik2010-04-021-4/+21
|
* adds missing requires for Object#blank? and Object#present?Xavier Noria2010-03-281-0/+2
|
* 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>
* removing spawn from SpawnMethodsAaron Patterson2010-03-101-6/+6
| | | | Signed-off-by: wycats <wycats@gmail.com>
* refactoring build_whereAaron Patterson2010-03-061-7/+7
| | | | Signed-off-by: wycats <wycats@gmail.com>
* avoid @lock_value not initialized warningSantiago Pastorino2010-02-221-1/+1
|
* Clear up some ivar warningsJeremy Kemper2010-01-271-3/+13
|
* Simplify finder method definitionsPratik Naik2010-01-211-13/+11
|
* Supplying Arel::SqlLiteral is much fasterPratik Naik2010-01-211-5/+12
|
* Use quoted_table_name with arel.from() if no from values explicitly ↵Pratik Naik2010-01-211-2/+4
| | | | supplied. Arel seems to be spending a lot of time figuring out the FROM value otherwise.
* Always use table.* in the finder query unless specifiedPratik Naik2010-01-211-1/+1
|
* Base.merge_conditions is no longer neededPratik Naik2010-01-201-2/+2
|
* Move array_of_strings? to RelationPratik Naik2010-01-201-2/+6
|
* Make scopes use relations under the hoodPratik Naik2010-01-161-25/+69
|
* Use Relation#except for reversing the orderPratik Naik2010-01-121-3/+2
|
* Delay building arel relation as long as possible for improved introspectionPratik Naik2010-01-121-78/+87
|
* Add Relation#create_with to explictily specify create scopePratik Naik2010-01-041-0/+4
|
* Rename a variable name for consistencyPratik Naik2010-01-031-1/+1
|
* Add Relation#includes to be an equivalent of current finder option :includePratik Naik2010-01-031-0/+4
|
* Make sure not to spalt string argumentsPratik Naik2010-01-021-1/+1
|
* Move predicate building to a stand alone PredicateBuilder classPratik Naik2010-01-011-30/+4
|
* Use Arel::Attribute when building where conditions from hashPratik Naik2010-01-011-5/+36
|
* Organize Relation methods into separate modulesPratik Naik2009-12-301-0/+132