- 02 11月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
In practical terms, this allows serialized columns and tz aware columns to be used in wheres that go through joins, where they previously would not behave correctly. Internally, this removes 1/3 of the cases where we rely on Arel to perform type casting for us. There were two non-obvious changes required for this. `update_all` on relation was merging its bind values with arel's in the wrong order. Additionally, through associations were assuming there would be no bind parameters in the preloader (presumably because the where would always be part of a join) [Melanie Gilman & Sean Griffin]
-
- 15 10月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
follow up for #17052
-
- 10 5月, 2014 2 次提交
-
-
由 Arthur Neves 提交于
-
由 Yves Senn 提交于
-
- 06 1月, 2014 1 次提交
-
-
由 Matthias Zirnstein 提交于
has_many definitions with "name" as singular and as plural e.g. has_many :welcome_posts_with_comment has_many :welcome_posts_with_comments Ruby mentions it with: lib/active_record/associations/builder/collection_association.rb:65: warning: method redefined; discarding old welcome_posts_with_comment_ids lib/active_record/associations/builder/collection_association.rb:65: warning: previous definition of welcome_posts_with_comment_ids was here lib/active_record/associations/builder/collection_association.rb:75: warning: method redefined; discarding old welcome_posts_with_comment_ids= lib/active_record/associations/builder/collection_association.rb:75: warning: previous definition of welcome_posts_with_comment_ids= was here
-
- 13 9月, 2013 1 次提交
-
-
由 Paul Nikitochkin 提交于
In order to remove duplication with joining arel where constraints with `AND`, all constraints on `build_arel` are collapsed into one head node: `Arel::Nodes::And` Closes: #11963
-
- 11 9月, 2013 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 18 8月, 2013 1 次提交
-
- 25 7月, 2013 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 09 7月, 2013 1 次提交
-
-
由 Akira Matsuda 提交于
Closes #11248.
-
- 14 6月, 2013 1 次提交
-
-
由 Aaron Patterson 提交于
For example, you need to change this: class Author < ActiveRecord::Base has_many :posts has_many :taggings, :through => :posts end class Post < ActiveRecord::Base has_one :tagging has_many :taggings end class Tagging < ActiveRecord::Base end To this: class Author < ActiveRecord::Base has_many :posts has_many :taggings, :through => :posts, :source => :tagging end class Post < ActiveRecord::Base has_one :tagging has_many :taggings end class Tagging < ActiveRecord::Base end
-
- 15 3月, 2013 1 次提交
-
-
由 Yves Senn 提交于
The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our Relation API is close to SQL terms I renamed `#uniq` to `#distinct`. There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue to work. I also updated the documentation to promote the use of `#distinct`.
-
- 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 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 29 11月, 2012 1 次提交
-
-
由 Jason Rush 提交于
Allows you to do BaseClass.new(:type => "SubClass") as well as parent.children.build(:type => "SubClass") or parent.build_child to initialize an STI subclass. Ensures that the class name is a valid class and that it is in the ancestors of the super class that the association is expecting.
-
- 11 8月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
Method compilation provides better performance and I think the code comes out cleaner as well. A knock on effect is that methods that get redefined produce warnings. I think this is a good thing. I had to deal with a bunch of warnings coming from our tests, though.
-
- 21 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
now everything is converted to the new style, this is not needed
-
- 20 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 13 7月, 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
-
- 17 1月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
See the CHANGELOG for details. Fixes #950.
-
由 Jon Leighton 提交于
This reverts commit c99d507f.
-
- 29 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 28 11月, 2011 1 次提交
-
-
由 Josh Susser 提交于
-
- 24 5月, 2011 1 次提交
-
-
由 Andrew White 提交于
-
- 17 3月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 24 12月, 2010 2 次提交
-
-
由 Szymon Nowak 提交于
Fix creation of has_many through records with custom primary_key option on belongs_to [#2990 state:resolved]
-
由 Jon Leighton 提交于
-
- 16 12月, 2010 4 次提交
-
-
由 Jon Leighton 提交于
Verify that creating a has_many through record where there is a default_scope on the join model works correctly (creates the join record with the default scope applied)
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
Verify that creating a has_many through record where there is a default_scope on the join model works correctly (creates the join record with the default scope applied)
-
由 Jon Leighton 提交于
-
- 31 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
-
- 20 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
-
- 19 10月, 2010 4 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
Support for :primary_key option on the source reflection of a through association, where the source is a has_one or has_many
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 14 10月, 2010 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-