- 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
-
- 07 1月, 2012 1 次提交
-
-
由 Bogdan Gusiev 提交于
-
- 24 12月, 2011 1 次提交
-
-
由 Alvaro Bautista 提交于
-
- 17 12月, 2011 1 次提交
-
-
由 Sergey Nartimov 提交于
-
- 13 9月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 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.
-
- 12 1月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 09 11月, 2010 1 次提交
-
-
由 David Chelimsky 提交于
- persisted? is the API defined in ActiveModel - makes it easier for extension libraries to conform to ActiveModel APIs without concern for whether the extended object is specifically ActiveRecord [#5927 state:committed] Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
- 20 10月, 2010 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 14 8月, 2010 2 次提交
-
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
- 05 6月, 2010 1 次提交
-
-
由 Raimonds Simanovskis 提交于
(otherwise some tests are failing which assume that this attribute will have Date value)
-
- 18 1月, 2010 1 次提交
-
-
由 Pratik Naik 提交于
-
- 08 9月, 2009 2 次提交
-
-
由 José Valim 提交于
Signed-off-by: NJoshua Peek <josh@joshpeek.com>
-
由 José Valim 提交于
Changed ActiveRecord to use new callbacks and speed up observers by only notifying events that are actually being consumed. Signed-off-by: NJoshua Peek <josh@joshpeek.com>
-
- 30 7月, 2009 1 次提交
-
-
由 Jeremy Kemper 提交于
Revert "Methods invoked within named scope Procs should respect the scope stack. [#1267 state:resolved]" This reverts commit 6a133765. Conflicts: activerecord/test/cases/named_scope_test.rb
-
- 16 7月, 2009 1 次提交
-
-
由 Szymon Nowak 提交于
[#765 state:committed] Signed-off-by: NJeremy Kemper <jeremy@bitsweat.net>
-
- 12 3月, 2009 1 次提交
-
-
由 Elijah Miller 提交于
Signed-off-by: NPratik Naik <pratiknaik@gmail.com>
-
- 07 3月, 2009 2 次提交
-
-
由 Adam Cooper 提交于
Ensure belongs_to association with a counter cache in name spaced model works [#1678 state:resolved] Signed-off-by: NPratik Naik <pratiknaik@gmail.com>
-
由 jvoorhis 提交于
Signed-off-by: NPratik Naik <pratiknaik@gmail.com>
-
- 25 1月, 2009 1 次提交
-
-
由 Pratik Naik 提交于
-
- 01 8月, 2008 1 次提交
-
-
由 Tarmo Tänav 提交于
Signed-off-by: NJoshua Peek <josh@joshpeek.com>
-
- 09 7月, 2008 1 次提交
-
-
由 Daniel Guettler 提交于
Ensure NamedScope#build/create/create!/new works as expected when named scope has hash conditions. [Daniel Guettler, Pratik Naik] [#419 state:resolved] Signed-off-by: NPratik Naik <pratiknaik@gmail.com>
-
- 28 6月, 2008 1 次提交
-
-
由 Pratik Naik 提交于
-
- 23 6月, 2008 1 次提交
-
-
由 Tarmo Tänav 提交于
-
- 30 4月, 2008 1 次提交
-
-
由 David Heinemeier Hansson 提交于
-
- 01 4月, 2008 1 次提交
-
-
由 Jeremy Kemper 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 24 3月, 2008 1 次提交
-
-
由 Rick Olson 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 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
-
- 08 10月, 2007 1 次提交
-
-
由 Michael Koziarski 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 17 9月, 2007 1 次提交
-
-
由 Michael Koziarski 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7500 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 03 9月, 2006 1 次提交
-
-
由 Jeremy Kemper 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 19 3月, 2006 1 次提交
-
-
由 David Heinemeier Hansson 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3941 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 06 3月, 2006 1 次提交
-
-
由 David Heinemeier Hansson 提交于
Fixed eager loading problems with single-table inheritance [Rick Olson] Added smarter table aliasing for eager associations for multiple self joins [Rick Olson] (closes #3580) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 14 12月, 2004 1 次提交
-
-
由 David Heinemeier Hansson 提交于
Added a better exception for when a type column is used in a table without the intention of triggering single-table inheritance. Added that single-table inheritance will only kick in if the inheritance_column (by default "type") is present. Otherwise, inheritance wont have any magic side effects git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 13 12月, 2004 1 次提交
-
-
由 David Heinemeier Hansson 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@132 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-
- 24 11月, 2004 1 次提交
-
-
由 David Heinemeier Hansson 提交于
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-