- 22 3月, 2012 1 次提交
-
-
由 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
-
- 08 3月, 2012 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 06 3月, 2012 1 次提交
-
-
由 Rafael Mendonça França 提交于
:strict
-
- 11 2月, 2012 1 次提交
-
-
由 Rick Martinez 提交于
-
- 03 2月, 2012 1 次提交
-
-
由 Jeremy Walker 提交于
-
- 01 2月, 2012 1 次提交
-
-
由 gregolsen 提交于
-
- 31 1月, 2012 1 次提交
-
-
由 gregolsen 提交于
-
- 17 1月, 2012 3 次提交
-
-
由 David Peter 提交于
If a model belongs_to two associations with the same class, then reset_counters will reset the wrong counter cache. Finding the right reflection should use the foreign_key instead, which should be unique.
-
由 Jon Leighton 提交于
See the CHANGELOG for details. Fixes #950.
-
由 Jon Leighton 提交于
This reverts commit c99d507f.
-
- 07 1月, 2012 1 次提交
-
-
由 Bogdan Gusiev 提交于
-
- 30 12月, 2011 1 次提交
-
-
由 Alexey Muranov 提交于
Test using fixtures with random names and model names, that is not following naming conventions but using set_fixture_class instead. It is expected that the table name be defined in the model, but this is not explicitly tested here. This will need to be fixed.
-
- 29 12月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
This is the 'top level' connection, inherited by any models that include ActiveRecord::Model or inherit from ActiveRecord::Base.
-
- 24 12月, 2011 4 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Alvaro Bautista 提交于
-
- 22 12月, 2011 1 次提交
-
-
由 Jakub Kuźma 提交于
added failing tests for has_many, has_one and belongs_to associations with strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051
-
- 17 12月, 2011 1 次提交
-
-
由 Sergey Nartimov 提交于
-
- 15 12月, 2011 1 次提交
-
-
由 Andrew Kaspick 提交于
Allow nested attributes in associations to update values in it's owner object. Fixes a regression from 3.0.x
-
- 09 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 30 11月, 2011 6 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Josh Susser 提交于
-
- 28 11月, 2011 1 次提交
-
-
由 Josh Susser 提交于
-
- 04 11月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
This is to avoid confusing newbies, and to be consistent with the fact that other options like :foreign_key already allow a symbol or a string.
-
- 14 10月, 2011 2 次提交
-
-
由 Jeremy Kemper 提交于
-
由 David Heinemeier Hansson 提交于
-
- 13 9月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
Previously we would just silently write the attribute. This can lead to subtle bugs (for example, see the change in AutosaveAssociation where a through association would wrongly gain an attribute. Also, ensuring that we never gain any new attributes after initialization will allow me to reduce our dependence on method_missing.
-
由 Jon Leighton 提交于
-
- 09 9月, 2011 1 次提交
-
-
由 Dmitry Polushkin 提交于
Test polymorphic record with optimistic locking and counter cache should be destoyed without catching the ActiveRecord::StaleObjectError.
-
- 06 9月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Ensure we are not comparing a string with a symbol in HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be.
-
- 05 9月, 2011 1 次提交
-
-
由 Arun Agrawal 提交于
Fixes #2832
-
- 29 8月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
The join_nodes must be passed to the JoinDependency initializer and therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556.
-
- 13 8月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 25 7月, 2011 1 次提交
-
-
由 Gabriel Horner 提交于
-