- 18 8月, 2013 1 次提交
-
- 25 7月, 2013 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 27 1月, 2013 1 次提交
-
-
由 Derek Kraan 提交于
because of an ambiguous column name. This happened if the association model had a default scope that referenced a third table, and the third table also referenced the original table (with an identical foreign_key). Mysql requires that ambiguous columns are deambiguated by using the full table.column syntax. Postgresql and Sqlite use a different syntax for updates altogether (and don't tolerate table.name syntax), so the fix requires always including the full table.column and discarding it later for Sqlite and Postgresql.
-
- 24 1月, 2013 3 次提交
-
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
- 20 1月, 2013 1 次提交
-
-
由 Chris Geihsler 提交于
-
- 18 1月, 2013 1 次提交
-
-
由 Jon Leighton 提交于
Suggested by @dhh. It doesn't affect the generated SQL, so seems reasonable to continue to allow it as an association option.
-
- 22 9月, 2012 1 次提交
-
-
由 Santiago Pastorino 提交于
This reverts commit 761bc751. This commit wasn't fixing any issue just using the same table for different models with different primary keys.
-
- 16 9月, 2012 1 次提交
-
-
由 Toshiyuki Kawanishi 提交于
-
- 29 8月, 2012 1 次提交
-
-
由 Pratik Naik 提交于
-
- 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.
-
- 21 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
interpolation is no longer a thing separate from "normal" assoc conditions.
-
- 20 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 27 4月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 26 4月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 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
-
- 06 3月, 2012 1 次提交
-
-
由 Rafael Mendonça França 提交于
:strict
-
- 09 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 30 11月, 2011 1 次提交
-
-
由 Josh Susser 提交于
-
- 05 9月, 2011 1 次提交
-
-
由 Arun Agrawal 提交于
Fixes #2832
-
- 03 6月, 2011 1 次提交
-
-
由 Arun Agrawal 提交于
-
- 24 5月, 2011 1 次提交
-
-
由 Andrew White 提交于
-
- 19 4月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Un-deprecate using 'default_scope' as a macro, but if you are calling the macro multiple times that will give deprecation warnings, and in 3.2 we will simply overwrite the default scope when you call the macro multiple times.
-
- 18 4月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Revert "Deprecate defining scopes with a callable (lambda, proc, etc) via the scope class method. Just define a class method yourself instead." This reverts commit f0e198bf. Conflicts: activerecord/test/models/post.rb
-
- 13 4月, 2011 3 次提交
-
-
由 Aaron Patterson 提交于
-
由 Jon Leighton 提交于
Deprecate defining scopes with a callable (lambda, proc, etc) via the scope class method. Just define a class method yourself instead.
-
由 Jon Leighton 提交于
Deprecated support for passing hashes and relations to default_scope, in favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details.
-
- 17 3月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 06 3月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Add a test for STI on the through where the through is nested, and change the code which support this
-
- 18 2月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
Allow building and then later saving has_many :through records, such that the join record is automatically saved too. This requires the :inverse_of option to be set on the source association in the join model. See the CHANGELOG for details. [#4329 state:resolved]
-
由 Jon Leighton 提交于
Ensure that association_ids uses the correct attribute where the association is a has_many :through with a :primary_key option on the source reflection. [#6376 state:resolved]
-
- 14 2月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Add interpolation of association conditions back in, in the form of proc { ... } rather than instance_eval-ing strings
-
- 08 2月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Correctly update counter caches on deletion for has_many :through [#2824 state:resolved]. Also fixed a bunch of other counter cache bugs in the process, as once I fixed this one others started appearing like nobody's business.
-
- 04 1月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Let AssociationCollection#find use #scoped to do its finding. Note that I am removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences.
-
- 23 12月, 2010 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 21 12月, 2010 2 次提交
-
-
由 Jon Leighton 提交于
has_many associations with :dependent => :delete_all should update the counter cache when deleting records
-
由 Jon Leighton 提交于
Fix problem where wrong keys are used in JoinAssociation when an association goes :through a belongs_to [#2801 state:resolved]
-
- 16 12月, 2010 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-