Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Remove ActiveRecord::Base.to_a | Jon Leighton | 2012-08-03 | 1 | -13/+13 |
| | | | | | On reflection, it seems like a bit of a weird method to have on ActiveRecord::Base, and it shouldn't be needed most of the time anyway. | ||||
* | Deprecate ActiveRecord::Base.scoped. | Jon Leighton | 2012-07-27 | 1 | -6/+6 |
| | | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders. | ||||
* | ActiveRecord::Base.all returns a Relation. | Jon Leighton | 2012-07-27 | 1 | -28/+28 |
| | | | | | | | | | | | Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway. | ||||
* | Fix #6635. We should call Scoping methods, before calling Array methods. | kennyj | 2012-06-10 | 1 | -0/+9 |
| | |||||
* | Fix fragile #assert_queries implementation and usages. | Steve Jorgensen | 2012-06-09 | 1 | -1/+0 |
| | | | | | | | | | Several tests that passed when run in the order they are loaded by rake test were failing when run in different sequences due to problems with the implementation of assert_queries and assert_no_queries as well as incorrect assumptions made about how many queries might be executed by a database adapter in various cases. | ||||
* | quarantine deprecated tests | Jon Leighton | 2012-05-18 | 1 | -38/+1 |
| | |||||
* | extract deprecated dynamic methods | Jon Leighton | 2012-05-04 | 1 | -2/+2 |
| | |||||
* | extract code from AR::Base | Jon Leighton | 2012-05-04 | 1 | -2/+2 |
| | |||||
* | clean up implementation of dynamic methods. use method compilation etc. | Jon Leighton | 2012-05-04 | 1 | -3/+2 |
| | |||||
* | find and replace deprecated keys | Jon Leighton | 2012-04-27 | 1 | -5/+5 |
| | |||||
* | %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other ↵ | Jon Leighton | 2012-04-27 | 1 | -7/+7 |
| | | | | things | ||||
* | remove unnecessary test code | Jon Leighton | 2012-04-27 | 1 | -4/+0 |
| | |||||
* | remove calls to find(:first), find(:last) and find(:all) | Jon Leighton | 2012-04-26 | 1 | -11/+11 |
| | |||||
* | remove deprecated #first calls | Jon Leighton | 2012-04-26 | 1 | -14/+0 |
| | |||||
* | remove deprecate #calculate calls | Jon Leighton | 2012-04-26 | 1 | -1/+1 |
| | |||||
* | fix #scoped deprecations | Jon Leighton | 2012-04-26 | 1 | -5/+6 |
| | |||||
* | remove deprecated scope stuff | Jon Leighton | 2012-04-26 | 1 | -19/+0 |
| | |||||
* | default_scope with a hash is deprecated | Jon Leighton | 2012-04-26 | 1 | -10/+0 |
| | |||||
* | extract deprecated code | Jon Leighton | 2012-04-25 | 1 | -5/+0 |
| | |||||
* | giving a hash to default scope should not be deprecated (well, not for this ↵ | Jon Leighton | 2012-04-25 | 1 | -2/+2 |
| | | | | reason) | ||||
* | Deprecate eager-evaluated scopes. | Jon Leighton | 2012-03-21 | 1 | -10/+35 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use this: scope :red, where(color: 'red') default_scope where(color: 'red') Use this: scope :red, -> { where(color: 'red') } default_scope { where(color: 'red') } The former has numerous issues. It is a common newbie gotcha to do the following: scope :recent, where(published_at: Time.now - 2.weeks) Or a more subtle variant: scope :recent, -> { where(published_at: Time.now - 2.weeks) } scope :recent_red, recent.where(color: 'red') Eager scopes are also very complex to implement within Active Record, and there are still bugs. For example, the following does not do what you expect: scope :remove_conditions, except(:where) where(...).remove_conditions # => still has conditions | ||||
* | Remove valid_scope_name? check - use ruby | Jon Leighton | 2012-03-21 | 1 | -19/+0 |
| | | | | | | | scope is syntactic sugar for defining a class method. Ruby allows redefining methods but emits a warning when run with -w. So let's not implement our own logic for this. Users should run with -w if they want to be warned about redefined methods. | ||||
* | Revert PR#5001 "removed unuseful require for reply as we are not using ↵ | Vishnu Atrai | 2012-02-12 | 1 | -0/+1 |
| | | | | | | require model" This reverts commit 7381596ea32aff47222af89e4bc66000f4597acb. | ||||
* | removed unuseful require for reply as we are not using require model | Karunakar (Ruby) | 2012-02-11 | 1 | -1/+0 |
| | |||||
* | remove requires of core_ext/array/random_access that no longer exists | lest | 2011-12-21 | 1 | -1/+0 |
| | |||||
* | call scope within unscoped to prevent duplication of where values | Sergey Nartimov | 2011-12-17 | 1 | -0/+5 |
| | |||||
* | #first doesn't take an order in this test | Damien Mathieu | 2011-09-06 | 1 | -1/+1 |
| | |||||
* | first and last orders the records by id | Damien Mathieu | 2011-09-06 | 1 | -2/+2 |
| | |||||
* | Refactor test case to use anonymous class - Thank you @tenderlove | Prem Sichanugrist | 2011-07-18 | 1 | -13/+8 |
| | |||||
* | Raise an ArgumentError if user passing less number of argument in the ↵ | Prem Sichanugrist | 2011-07-17 | 1 | -0/+15 |
| | | | | | | | | | | | | | dynamic finder The previous behavior was unintentional, and some people was relying on it. Now the dynamic finder will always expecting the number of arguments to be equal or greater (so you can still pass the options to it.) So if you were doing this and expecting the second argument to be nil: User.find_by_username_and_group("sikachu") You'll now get `ArgumentError: wrong number of arguments (1 for 2).` You'll then have to do this: User.find_by_username_and_group("sikachu", nil) | ||||
* | please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT | Aaron Patterson | 2011-06-06 | 1 | -1/+1 |
| | |||||
* | Merge pull request #1462 from arunagw/test_added_for_namedscope | José Valim | 2011-06-05 | 1 | -0/+8 |
|\ | | | | | Test added for namedscope target. | ||||
| * | Test added for namedscope target. | Arun Agrawal | 2011-06-03 | 1 | -0/+8 |
| | | |||||
* | | Refactor Active Record test connection setup. Please see the ↵ | Jon Leighton | 2011-06-04 | 1 | -1/+1 |
|/ | | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. | ||||
* | Modified NamedScopeTest to use CollectionAssociation. | Michael Ebens | 2011-05-11 | 1 | -1/+1 |
| | |||||
* | Revert "Deprecate defining scopes with a callable (lambda, proc, etc) via ↵ | Jon Leighton | 2011-04-17 | 1 | -6/+0 |
| | | | | | | | | | | the scope class method. Just define a class method yourself instead." This reverts commit f0e198bfa1e3f9689e0cde1d194a44027fc90b3c. Conflicts: activerecord/test/models/post.rb | ||||
* | Deprecate defining scopes with a callable (lambda, proc, etc) via the scope ↵ | Jon Leighton | 2011-04-12 | 1 | -0/+6 |
| | | | | class method. Just define a class method yourself instead. | ||||
* | ActiveRecord::Base.scopes hash is not needed | Jon Leighton | 2011-04-12 | 1 | -11/+0 |
| | |||||
* | Removing the scope-caching which happens on association proxies, because the ↵ | Jon Leighton | 2011-04-12 | 1 | -10/+15 |
| | | | | query is already cached by the query cacher. For formalised proof see http://www.youtube.com/watch?v=wDefXLb-FDs | ||||
* | Delegate first!, last!, any? and many? to scoped | Andrew White | 2011-03-29 | 1 | -1/+16 |
| | |||||
* | fixes: ActiveRecord::Base.scopes includes all scopes defined in all subclasses | Eric Allam | 2011-02-24 | 1 | -0/+4 |
| | |||||
* | Split AssociationProxy into an Association class (and subclasses) which ↵ | Jon Leighton | 2011-02-18 | 1 | -1/+1 |
| | | | | manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more. | ||||
* | Replace rudimentary named_scope with scope. [#6052 state:resolved] | Pavel Gorbokon | 2010-12-15 | 1 | -21/+21 |
| | | | | | | | * rename method names (actually in tests) * rename instance variable @_named_scopes_cache to @_scopes_cache * rename references in doc comments * don't touch CHANGELOG :) | ||||
* | Models should be equals even after destroyed | Santiago Pastorino | 2010-11-16 | 1 | -1/+1 |
| | | | | [#5978 state:committed] | ||||
* | scopes can take an object that responds to `call` | Aaron Patterson | 2010-10-19 | 1 | -0/+6 |
| | |||||
* | Cleanup deprecation warnings in active record | Carlos Antonio da Silva | 2010-09-06 | 1 | -4/+0 |
| | | | | 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 | ||||
* | Dynamic finder method like scoped_by_* create methods so that | Neeraj Singh | 2010-08-03 | 1 | -0/+6 |
| | | | | | | | method_missing is not hit next time. Adding a test for this scenario. Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | renaming tests by removing proxy_options from names | Neeraj Singh | 2010-07-21 | 1 | -5/+5 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Push a failing test for issues [#4994] and [#5003]. | José Valim | 2010-06-29 | 1 | -0/+6 |
| |