- 05 4月, 2013 1 次提交
-
-
由 Neeraj Singh 提交于
-
- 30 3月, 2013 2 次提交
-
-
由 Takehiro Adachi 提交于
The file name should be name_scoping_test.rb and the class should be `NamedScopingTest` according to ActiveRecord::Scoping::Name
-
由 Takehiro Adachi 提交于
The scoping/default.rb and scoping/named.rb got moved under scoping/ in commit 2b22564c, but the tests never did.
-
- 28 3月, 2013 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 19 3月, 2013 1 次提交
-
-
由 Krzysztof Jurewicz 提交于
-
- 08 3月, 2013 2 次提交
-
-
由 Carlos Antonio da Silva 提交于
Introduced in f1082b85. Full changelog in 9f007d7f. [ci skip]
-
Currently Post.active.inactive will result in Post.inactive since the last where clause wins when scopes are merged. This pull request will merge all scopes ( barring defaul scope) using AND. The default scope will be overridden if another scope acts on the same where clause. closes #7365
-
- 03 8月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
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.
-
- 28 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
-
- 27 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
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.
-
- 10 6月, 2012 2 次提交
-
-
由 kennyj 提交于
-
由 Steve Jorgensen 提交于
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.
-
- 18 5月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 04 5月, 2012 3 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 27 4月, 2012 6 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 26 4月, 2012 3 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 25 4月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 22 3月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
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
-
由 Jon Leighton 提交于
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.
-
- 12 2月, 2012 1 次提交
-
-
由 Vishnu Atrai 提交于
This reverts commit 7381596e.
-
- 11 2月, 2012 1 次提交
-
-
由 Karunakar (Ruby) 提交于
-
- 22 12月, 2011 1 次提交
-
-
由 lest 提交于
-
- 17 12月, 2011 1 次提交
-
-
由 Sergey Nartimov 提交于
-
- 06 9月, 2011 2 次提交
-
-
由 Damien Mathieu 提交于
-
由 Damien Mathieu 提交于
-
- 18 7月, 2011 2 次提交
-
-
由 Prem Sichanugrist 提交于
-
由 Prem Sichanugrist 提交于
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)
-
- 07 6月, 2011 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 05 6月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Refactor Active Record test connection setup. Please see the 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.
-
- 03 6月, 2011 1 次提交
-
-
由 Arun Agrawal 提交于
-