1. 04 9月, 2014 1 次提交
    • S
      Skip StatementCache for eager loaded associations (Fixes #16761) · 4abbdbdf
      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.
      4abbdbdf
  2. 19 8月, 2014 1 次提交
  3. 26 6月, 2014 1 次提交
    • S
      Deprecate automatic counter caches on has_many :through · d730e374
      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.
      d730e374
  4. 15 5月, 2014 1 次提交
    • N
      Make filter_binds filter out symbols that are equal to strings · 1d316ac1
      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.
      1d316ac1
  5. 05 5月, 2014 1 次提交
  6. 12 4月, 2014 1 次提交
  7. 03 4月, 2014 2 次提交
  8. 28 10月, 2013 1 次提交
  9. 11 9月, 2013 1 次提交
  10. 30 8月, 2013 1 次提交
  11. 18 8月, 2013 1 次提交
  12. 25 7月, 2013 1 次提交
  13. 27 1月, 2013 1 次提交
    • D
      Fix cases where delete_records on a has_many association caused errors · 0a71c7b8
      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.
      0a71c7b8
  14. 24 1月, 2013 3 次提交
  15. 20 1月, 2013 1 次提交
  16. 18 1月, 2013 1 次提交
    • J
      Undeprecate the :extend option · 5937bd02
      Jon Leighton 提交于
      Suggested by @dhh.
      
      It doesn't affect the generated SQL, so seems reasonable to continue to
      allow it as an association option.
      5937bd02
  17. 22 9月, 2012 1 次提交
  18. 16 9月, 2012 1 次提交
  19. 29 8月, 2012 1 次提交
  20. 28 7月, 2012 1 次提交
  21. 21 7月, 2012 1 次提交
    • J
      rm unnecessary test · 2f6e33d3
      Jon Leighton 提交于
      interpolation is no longer a thing separate from "normal" assoc
      conditions.
      2f6e33d3
  22. 20 7月, 2012 1 次提交
  23. 27 4月, 2012 1 次提交
  24. 26 4月, 2012 1 次提交
  25. 22 3月, 2012 1 次提交
    • J
      Deprecate eager-evaluated scopes. · 0a12a5f8
      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
      0a12a5f8
  26. 06 3月, 2012 1 次提交
  27. 09 12月, 2011 1 次提交
  28. 30 11月, 2011 1 次提交
  29. 05 9月, 2011 1 次提交
  30. 03 6月, 2011 1 次提交
  31. 24 5月, 2011 1 次提交
  32. 19 4月, 2011 1 次提交
  33. 18 4月, 2011 1 次提交
  34. 13 4月, 2011 3 次提交
  35. 17 3月, 2011 1 次提交