1. 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
  2. 05 5月, 2014 1 次提交
  3. 12 4月, 2014 1 次提交
  4. 03 4月, 2014 2 次提交
  5. 28 10月, 2013 1 次提交
  6. 11 9月, 2013 1 次提交
  7. 30 8月, 2013 1 次提交
  8. 18 8月, 2013 1 次提交
  9. 25 7月, 2013 1 次提交
  10. 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
  11. 24 1月, 2013 3 次提交
  12. 20 1月, 2013 1 次提交
  13. 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
  14. 22 9月, 2012 1 次提交
  15. 16 9月, 2012 1 次提交
  16. 29 8月, 2012 1 次提交
  17. 28 7月, 2012 1 次提交
  18. 21 7月, 2012 1 次提交
    • J
      rm unnecessary test · 2f6e33d3
      Jon Leighton 提交于
      interpolation is no longer a thing separate from "normal" assoc
      conditions.
      2f6e33d3
  19. 20 7月, 2012 1 次提交
  20. 27 4月, 2012 1 次提交
  21. 26 4月, 2012 1 次提交
  22. 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
  23. 06 3月, 2012 1 次提交
  24. 09 12月, 2011 1 次提交
  25. 30 11月, 2011 1 次提交
  26. 05 9月, 2011 1 次提交
  27. 03 6月, 2011 1 次提交
  28. 24 5月, 2011 1 次提交
  29. 19 4月, 2011 1 次提交
  30. 18 4月, 2011 1 次提交
  31. 13 4月, 2011 3 次提交
  32. 17 3月, 2011 1 次提交
  33. 06 3月, 2011 1 次提交
  34. 18 2月, 2011 2 次提交