Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add scoping and unscoped as the syntax to replace the old with_scope and ↵ | José Valim | 2010-06-29 | 1 | -202/+5 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | ||||
* | with_exclusive_scope does not work properly if ARel is passed. It does work ↵ | Neeraj Singh | 2010-06-29 | 1 | -0/+6 |
| | | | | | | | | nicely if hash is passed. Blow up if user is attempting it pass ARel to with_exclusive_scope. [#3838 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Support for multiple selects added | Neeraj Singh and Santiago Pastorino | 2010-06-25 | 1 | -3/+5 |
| | | | | [#4841 state:committed] | ||||
* | Final iteration of use better testing methods | Neeraj Singh | 2010-05-19 | 1 | -1/+1 |
| | | | | | | [#4652 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Remove Model.clear_default_scope | Pratik Naik | 2010-05-18 | 1 | -12/+0 |
| | |||||
* | Modified default_scope to merge with any pre-existing default_scope | David Chelimsky + Brian Tatnall | 2010-05-15 | 1 | -2/+29 |
| | | | | | | | | | | | | and added AR::Base::clear_default_scope - clear_default_scope provides users who rely on the old behaviour of each call to default_scope overwriting any previous default scopes an opportunity to maintain that behaviour. [#4583 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | cleaning up a bunch of parse time warnings in AR [#4186 state:resolved] | Aaron Patterson | 2010-03-15 | 1 | -1/+1 |
| | | | | Signed-off-by: wycats <wycats@gmail.com> | ||||
* | Fix a bug where default_scope was overriding attributes given on model ↵ | Henry Hsu | 2010-02-26 | 1 | -0/+10 |
| | | | | | | initialization [#3218 status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Make default_scope work with Relations | Pratik Naik | 2010-01-23 | 1 | -1/+7 |
| | |||||
* | Remove Relation#where_clause | Pratik Naik | 2010-01-19 | 1 | -4/+4 |
| | |||||
* | Get rid of Relation#order_clauses | Pratik Naik | 2010-01-18 | 1 | -3/+3 |
| | |||||
* | Make merging of order values consistent | Pratik Naik | 2010-01-17 | 1 | -4/+4 |
| | |||||
* | Make scopes use relations under the hood | Pratik Naik | 2010-01-16 | 1 | -33/+32 |
| | |||||
* | Don't publicize with_scope for tests since it may shadow public misuse | Jeremy Kemper | 2009-12-28 | 1 | -87/+87 |
| | |||||
* | Moved relation's test to relation_test. | Emilio Tagua | 2009-10-05 | 1 | -2/+2 |
| | |||||
* | Merge commit 'rails/master' | Emilio Tagua | 2009-08-08 | 1 | -0/+1 |
|\ | | | | | | | | | | | Conflicts: activerecord/test/cases/adapter_test.rb activerecord/test/cases/method_scoping_test.rb | ||||
| * | Oracle generates different ORDER BY fragment | Raimonds Simanovskis | 2009-08-06 | 1 | -1/+2 |
| | | |||||
* | | Introduced ActiveRecord::Relation, a layer between an ARel relation and an ↵ | Emilio Tagua | 2009-07-21 | 1 | -2/+2 |
| | | | | | | | | AR relation | ||||
* | | Merge commit 'rails/master' | Emilio Tagua | 2009-05-18 | 1 | -0/+10 |
|\| | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record.rb Updated: Arel submodule | ||||
| * | Make sure default_scope#create checks for options[:conditions] [#2181 ↵ | Pratik Naik | 2009-05-18 | 1 | -0/+10 |
| | | | | | | | | state:resolved] [James Le Cuirot] | ||||
* | | Merge commit 'rails/master' | Emilio Tagua | 2009-05-02 | 1 | -3/+3 |
|\| | |||||
| * | Default scope :order should be overridden by named scopes. | Alexander Podgorbunsky | 2009-05-01 | 1 | -3/+3 |
| | | | | | | | | | | | | [#2346 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | ||||
* | | construct_finder_sql now use Arel | Emilio Tagua | 2009-04-24 | 1 | -1/+1 |
|/ | |||||
* | Fix models load order to be able to run unit tests. | Emilio Tagua | 2009-04-23 | 1 | -1/+1 |
| | | | | | | [#2550 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | ||||
* | Don't duplicate :order from scope and options, it makes mysql do extra work | Jeremy Kemper | 2009-03-10 | 1 | -2/+4 |
| | |||||
* | Ensure nested with_scope merges conditions inside out [#2193 state:resolved] | Manfred Stienstra | 2009-03-10 | 1 | -5/+33 |
| | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | update the default scope test to take the model's default scope into account | rick | 2009-02-25 | 1 | -1/+1 |
| | |||||
* | Ensure whitespaces are stripped when merging string joins. [#1297 ↵ | Filip H.F. "FiXato" Slagter | 2009-01-28 | 1 | -0/+10 |
| | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Ensure Model#last doesn't affects order for another finders inside the same ↵ | Daniel Luz | 2008-12-21 | 1 | -0/+18 |
| | | | | | | scope [#1499 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Fix default_scope to work in combination with named scopes | Tom Stuart | 2008-11-17 | 1 | -3/+9 |
| | | | | Signed-off-by: David Heinemeier Hansson <david@loudthinking.com> | ||||
* | Added default_scope to Base [#1381 state:committed] (Paweł Kondzior) | Pratik Naik | 2008-11-16 | 1 | -0/+61 |
| | |||||
* | Revert "Added default_scope to Base [#1381 state:committed] (Paweł ↵ | David Heinemeier Hansson | 2008-11-16 | 1 | -38/+0 |
| | | | | | | Kondzior)" -- won't gel with threads. This reverts commit ff594b2bc94ff2a942fe6ca05672387722dee686. | ||||
* | Added default_scope to Base [#1381 state:committed] (Paweł Kondzior) | David Heinemeier Hansson | 2008-11-16 | 1 | -0/+38 |
| | |||||
* | Allowed passing arrays-of-strings to :join everywhere. Merge duplicate join ↵ | Pivotal Labs | 2008-09-24 | 1 | -0/+30 |
| | | | | | | | strings to avoid table aliasing problems. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1077 state:committed] | ||||
* | Merge scoped :joins together instead of overwriting them. May expose scoping ↵ | Andrew White | 2008-08-28 | 1 | -2/+79 |
| | | | | | | | | bugs in your code! [#501 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | ||||
* | Added missing fixtures for tests which fail to run independently if run ↵ | Tarmo Tänav | 2008-08-04 | 1 | -1/+1 |
| | | | | | | after schema reset Signed-off-by: Michael Koziarski <michael@koziarski.com> | ||||
* | Fix column collision with named_scope and :joins. [#46 state:resolved] | Mark Catley | 2008-06-22 | 1 | -0/+10 |
| | |||||
* | Ensure :select passed in options overrides the one from the scope. [#239 ↵ | Andrew White | 2008-05-29 | 1 | -0/+16 |
| | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Fix merging blank conditions. Closes #10764 [mcmire, cavalle] | Jeremy Kemper | 2008-03-23 | 1 | -2/+22 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9082 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/rails | Jeremy Kemper | 2008-01-21 | 1 | -7/+7 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Fix paths | Jeremy Kemper | 2008-01-18 | 1 | -5/+5 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Move tests to cases | Jeremy Kemper | 2008-01-18 | 1 | -0/+416 |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de |