- 30 7月, 2016 1 次提交
-
-
由 Takashi Kokubun 提交于
Fixes #24093
-
- 12 1月, 2016 1 次提交
-
-
由 Matthew Draper 提交于
Given a default_scope on a parent of the current class, where that parent is not the base class, the parent's STI condition would become attached to the evaluated default scope, and then override the child's own STI condition. Instead, we can treat the STI condition as though it is a default scope, and skip it in this situation: the scope will be merged into the base relation, which already contains the correct STI condition. Fixes #22426.
-
- 21 10月, 2015 1 次提交
-
-
由 kal 提交于
-
- 08 7月, 2015 1 次提交
-
-
由 Rafael Mendonça França 提交于
When preload is used in a default scope the preload_values were returning nested arrays and causing the preloader to fail because it doesn't know how to deal with nested arrays. So before calling preload! we need to splat the arguments. This is not needed to includes because it flatten its arguments.
-
- 07 4月, 2015 1 次提交
-
-
由 Tristan Gamilis 提交于
Previously has_many associations assumed a counter_cache was to be used based on the presence of an appropriately named column. This is inconsistent, since the inverse belongs_to association will not make this assumption. See issues #19042 #8446. This commit checks for the presence of the counter_cache key in the options of either the has_many or belongs_to association as well as ensuring that the *_count column is present.
-
- 25 3月, 2015 1 次提交
-
-
由 Cody Cutrer 提交于
the newer method used for discriminating new records did not use the older and more robust method used for instantiating existing records, but did have a better post-check to ensure the sublass was in the hierarchy. so move the descendants check to find_sti_class, and then simply call find_sti_class from subclass_from_attributes now with fixed specs
-
- 29 1月, 2015 1 次提交
-
-
由 Matthew Draper 提交于
Post.where('id = 1').or(Post.where('id = 2')) # => SELECT * FROM posts WHERE (id = 1) OR (id = 2) [Matthew Draper & Gael Muller]
-
- 05 1月, 2015 1 次提交
-
- 09 12月, 2014 1 次提交
-
-
To be possible to use a custom column name to save/read the polymorphic associated type in a has_many or has_one polymorphic association, now users can use the option :foreign_type to inform in what column the associated object type will be saved.
-
- 03 12月, 2014 1 次提交
-
-
由 Melissa Xie 提交于
-
- 21 11月, 2014 1 次提交
-
-
由 siddharth@vinsol.com 提交于
on the joined assoiciation
-
- 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]
-
- 13 10月, 2014 1 次提交
-
- 04 9月, 2014 1 次提交
-
-
由 Sammy Larbi 提交于
Eagerly loaded collection and singular associations are ignored by the StatementCache, which causes errors when the queries they generate reference columns that were not eagerly loaded. This commit skips the creation of the StatementCache as a fix for these scenarios.
-
- 19 8月, 2014 1 次提交
-
-
由 Kassio Borges 提交于
Fixes #15821.
-
- 26 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
Reliant on https://github.com/rails/rails/pull/15747 but pulled to a separate PR to reduce noise. `has_many :through` associations have the undocumented behavior of automatically detecting counter caches. However, the way in which it does so is inconsistent with counter caches everywhere else, and doesn't actually work consistently. As with normal `has_many` associations, the user should specify the counter cache on the `belongs_to`, if they'd like it updated.
-
- 15 5月, 2014 1 次提交
-
-
由 Nat Budin 提交于
ActiveRecord::Relation::Merger's filter_binds method does not filter out bind variables when one of the attribute nodes has a string name, but the other has a symbol name, even when those names are actually equal. This can result in there being more bind variables than placeholders in the generated SQL. This is particularly an issue for PostgreSQL, where this is treated as an error. This patch changes the filter_binds method to make it convert both attribute names to strings before comparing.
-
- 05 5月, 2014 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
- 12 4月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 03 4月, 2014 2 次提交
-
-
由 Jan Habermann 提交于
-
由 Jefferson Lai 提交于
CollectionProxy should be able to reuse the behavior (methods) of its parent class, but with its own state. This change allows CollectionProxy to use the arel object corresponding to its association's scope.
-
- 28 10月, 2013 1 次提交
-
-
由 Paul Nikitochkin 提交于
Fixes: #12242, #9517, #10240
-
- 11 9月, 2013 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 30 8月, 2013 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 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 提交于
-