- 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 次提交
-
-
由 Bogdan Gusiev 提交于
This is a regression 4.0 -> 4.1 fix. In 4.1.0 Relation#join is delegated to Arel#SelectManager. In 4.0 series it is delegated to Array#join This patch puts back the behaviour of 4.0
-
- 24 4月, 2014 1 次提交
-
-
由 Jefferson Lai 提交于
Changed the call to a scope block to be evaluated with instance_eval. The result is that ScopeRegistry can use the actual class instead of base_class when caching scopes so queries made by classes with a common ancestor won't leak scopes.
-
- 05 4月, 2013 2 次提交
-
-
由 Jon Leighton 提交于
See #9869 and #9929. The problem arises from the following example: class Project < ActiveRecord::Base scope :completed, -> { where completed: true } end class MajorProject < Project end When calling: MajorProject.where(tasks_count: 10).completed This expands to: MajorProject.where(tasks_count: 10).scoping { MajorProject.completed } However the lambda for the `completed` scope is defined on Project. This means that when it is called, `self` is Project rather than MajorProject. So it expands to: MajorProject.where(tasks_count: 10).scoping { Project.where(completed: true) } Since the scoping was applied on MajorProject, and not Project, this fails to apply the tasks_count condition. The solution is to make scoping apply across STI classes. I am slightly concerned about the possible side-effects of this, but no tests fail and it seems ok. I guess we'll see.
-
由 Neeraj Singh 提交于
-
- 24 1月, 2013 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 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.
-
- 27 4月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 04 4月, 2012 1 次提交
-
-
由 Benedikt Deicke 提交于
-
- 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
-
- 12 7月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 03 6月, 2011 1 次提交
-
-
由 Arun Agrawal 提交于
-
- 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 1 次提交
-
-
由 Jon Leighton 提交于
Deprecate defining scopes with a callable (lambda, proc, etc) via the scope class method. Just define a class method yourself instead.
-
- 01 2月, 2011 1 次提交
-
-
由 Glenn Vanderburg 提交于
Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
- 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.
-
- 13 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
Add some tests for functionality in JoinAssociation which already exists but was previously untested
-
- 10 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
Add support for nested through associations in JoinAssociation. Hence Foo.joins(:bar) will work for through associations. There is some duplicated code now, which will be refactored.
-
- 06 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
Refactoring JoinDependency and friends. This improves the code (IMO) including adding some explanatory comments, but more importantly structures it in such a way as to allow a JoinAssociation to produce an arbitrary number of actual joins, which will be necessary for nested has many through support. Also added 3 tests covering functionality which existed but was not previously covered.
-
- 04 6月, 2010 1 次提交
-
-
由 Pratik Naik 提交于
-
- 18 1月, 2010 1 次提交
-
-
由 Pratik Naik 提交于
-
- 10 8月, 2009 1 次提交
-
-
由 Tristan Dunn 提交于
-
- 24 3月, 2008 1 次提交
-
-
由 Rick Olson 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 26 1月, 2008 1 次提交
-
-
由 Michael Koziarski 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 18 1月, 2008 1 次提交
-
-
由 Jeremy Kemper 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 16 11月, 2005 1 次提交
-
-
由 Jeremy Kemper 提交于
Ticket #1874 - Firebird adapter r3107@asus: jeremy | 2005-11-16 00:06:14 -0800 quote column aliases r3108@asus: jeremy | 2005-11-16 00:08:12 -0800 quote columns in construct_conditions_from_arguments. update sequence_name docs. introduce prefetched primary keys. r3109@asus: jeremy | 2005-11-16 00:09:08 -0800 double-quote rather than single-quote sqlite columns r3110@asus: jeremy | 2005-11-16 00:09:56 -0800 quote column names and use attribute_condition in validates_uniqueness_of r3111@asus: jeremy | 2005-11-16 00:12:24 -0800 Use QUOTED_TYPE constant in tests r3112@asus: jeremy | 2005-11-16 00:13:28 -0800 restrict test_inserts_with_pre_and_suffix to those adapters which support migrations r3113@asus: jeremy | 2005-11-16 00:14:09 -0800 Use QUOTED_TYPE constant in tests r3114@asus: jeremy | 2005-11-16 00:14:30 -0800 Use QUOTED_TYPE constant in tests git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3051 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 05 11月, 2005 1 次提交
-
-
由 David Heinemeier Hansson 提交于
Added extension capabilities to has_many and has_and_belongs_to_many proxies [DHH] Added find_or_create_by_X as a second type of dynamic finder that'll create the record if it doesn't already exist [DHH] Added constrain scoping for creates using a hash of attributes bound to the :creation key [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 23 7月, 2005 1 次提交
-
-
由 David Heinemeier Hansson 提交于
Added support for calling constrained class methods on has_many and has_and_belongs_to_many collections #1764 [Tobias Luetke] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 03 7月, 2005 1 次提交
-
-
由 David Heinemeier Hansson 提交于
Fixed that single-table inheritance sub-classes couldn't be used to limit the result set with eager loading #1215 [Chris McGrath] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1619 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 10 4月, 2005 1 次提交
-
-
由 David Heinemeier Hansson 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1131 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 03 4月, 2005 1 次提交
-
-
由 David Heinemeier Hansson 提交于
Added new Base.find API and deprecated find_all, find_first. Added preliminary support for eager loading of associations git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1077 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-