1. 30 9月, 2013 1 次提交
    • T
      Fix AR#method_missing re-dispatching into overwritten attribute methods. · e9bf87f0
      thedarkone 提交于
      This was happening when a `super` call in an overwritten attribute method
      was triggering a method_missing fallback, because attribute methods
      haven't been generated yet.
      
        class Topic < ActiveRecord::Base
          def title
            # `super` would re-invoke this method if define_attribute_methods
            # hasn't been called yet resulting in double '!' appending
            super + '!'
          end
        end
      e9bf87f0
  2. 16 7月, 2013 1 次提交
  3. 09 7月, 2013 1 次提交
  4. 26 6月, 2013 1 次提交
  5. 22 5月, 2013 1 次提交
  6. 17 5月, 2013 2 次提交
  7. 11 5月, 2013 1 次提交
  8. 28 4月, 2013 1 次提交
  9. 06 4月, 2013 1 次提交
  10. 19 3月, 2013 1 次提交
  11. 18 11月, 2012 2 次提交
  12. 17 11月, 2012 2 次提交
  13. 29 10月, 2012 1 次提交
    • F
      AR::AttributeMethods#[] raises AM::AttributeMissingError for missing attributes. · 10f6f90d
      Francesco Rodriguez 提交于
      This fixes the following behaviour:
      
          class Person < ActiveRecord::Base
            belongs_to :company
          end
      
          # Before:
          person = Person.select('id').first
          person[:name]       # => nil
          person.name         # => ActiveModel::MissingAttributeError: missing_attribute: name
          person[:company_id] # => nil
          person.company      # => nil
      
          # After:
          person = Person.select('id').first
          person[:name]       # => ActiveModel::MissingAttributeError: missing_attribute: name
          person.name         # => ActiveModel::MissingAttributeError: missing_attribute: name
          person[:company_id] # => ActiveModel::MissingAttributeError: missing_attribute: company_id
          person.company      # => ActiveModel::MissingAttributeError: missing_attribute: company_id
      
      Fixes #5433.
      10f6f90d
  14. 12 10月, 2012 1 次提交
    • J
      Revert "Key the attributes hash with symbols" · 9e5f7cc6
      Jon Leighton 提交于
      This reverts commit 86c3dfbd.
      
      Conflicts:
      	activerecord/lib/active_record/attribute_methods/read.rb
      
      Reason: whilst this increased performance, it also presents a DoS risk
      via memory exhaustion if users were allowing user input to dictate the
      arguments of read/write_attribute. I will investigate alternative ways
      to cut down on string allocations here.
      9e5f7cc6
  15. 04 9月, 2012 1 次提交
  16. 31 8月, 2012 1 次提交
    • J
      Key the attributes hash with symbols · 86c3dfbd
      Jon Leighton 提交于
      This is a performance/GC optimisation.
      
      In theory, this could be optimised by the implementation (last time I
      checked, this would have no effect on JRuby). But in practise, this make
      attribute access faster.
      86c3dfbd
  17. 26 8月, 2012 2 次提交
  18. 18 8月, 2012 1 次提交
  19. 03 8月, 2012 1 次提交
  20. 28 7月, 2012 1 次提交
  21. 18 7月, 2012 1 次提交
  22. 28 6月, 2012 3 次提交
  23. 24 5月, 2012 1 次提交
    • V
      Revert "Remove blank trailing comments" · 1ad0b378
      Vijay Dev 提交于
      This reverts commit fa6d921e.
      
      Reason: Not a fan of such massive changes. We usually close such changes
      if made to Rails master as a pull request. Following the same principle
      here and reverting.
      
      [ci skip]
      1ad0b378
  24. 20 5月, 2012 1 次提交
    • H
      Remove blank trailing comments · fa6d921e
      Henrik Hodne 提交于
      For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace
      with the first match, and voilà! Note that the regex matches a little bit too
      much, so you probably want to `git add -i .` and go through every single diff
      to check if it actually should be changed.
      fa6d921e
  25. 30 4月, 2012 1 次提交
  26. 27 4月, 2012 2 次提交
  27. 07 3月, 2012 1 次提交
  28. 01 3月, 2012 1 次提交
  29. 28 2月, 2012 1 次提交
  30. 17 2月, 2012 1 次提交
  31. 12 2月, 2012 1 次提交
  32. 11 2月, 2012 1 次提交
  33. 10 2月, 2012 1 次提交