- 22 3月, 2012 5 次提交
-
-
由 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 提交于
-
由 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.
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 21 3月, 2012 2 次提交
-
-
由 Travis Jeffery 提交于
When generating a migration that removes a field with an index, the down will add both the field and its index.
-
由 Marcelo Silveira 提交于
-
- 19 3月, 2012 1 次提交
-
-
由 Sandeep 提交于
-
- 18 3月, 2012 2 次提交
-
-
由 Jared Armstrong 提交于
Fix bug with autosave collection association on new record with a marked for destroy record in autosave collection.
-
由 Ruben Davila 提交于
-
- 17 3月, 2012 4 次提交
-
-
由 Jonathan R. Wallace 提交于
-
由 kennyj 提交于
-
由 Rafael Mendonça França 提交于
-
由 Mark Larimer 提交于
This reverts commit 55df1df9.
-
- 16 3月, 2012 5 次提交
-
-
由 Thiago Almeida 提交于
-
由 Thiago Almeida 提交于
-
由 Thiago Almeida 提交于
-
由 Aaron Patterson 提交于
-
由 Yasuo Honda 提交于
-
- 15 3月, 2012 3 次提交
-
-
由 Waseem Ahmad 提交于
-
由 Bogdan Gusiev 提交于
-
由 kennyj 提交于
-
- 14 3月, 2012 3 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
-
由 kennyj 提交于
-
- 13 3月, 2012 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 12 3月, 2012 4 次提交
-
-
由 Jonathan Rochkind 提交于
deprecated clear_stale_active_connections! can call #reap instead of no-op'ing, #reap does the same thing
-
由 Andrew White 提交于
-
由 Andrew White 提交于
-
由 Denis Jean 提交于
add test to show offset query_methods on mysql & mysql2 change test to cover public API
-
- 11 3月, 2012 1 次提交
-
-
由 Michael de Silva 提交于
added clarification stating the counter_cache attribute needs to be created on the associate class via a migration
-
- 09 3月, 2012 6 次提交
-
-
由 Alexey Vakhov 提交于
-
由 Rafael Mendonça França 提交于
Also add missing entries and use the formating convention
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
make active_connection? return true only if there is an open connection in use for the current thread. fixes #5330
-
由 Vijay Dev 提交于
Last commit message should not have said 'Rails 4' either
-
由 Vijay Dev 提交于
-
- 08 3月, 2012 3 次提交
-
-
由 kennyj 提交于
-
由 Rafael Mendonça França 提交于
-
由 kuahyeow 提交于
Add tests to test that through associations are not readonly, and we can update the records we retrive from the association
-