1. 29 9月, 2013 1 次提交
  2. 16 7月, 2013 1 次提交
  3. 10 7月, 2013 1 次提交
  4. 09 7月, 2013 1 次提交
  5. 04 7月, 2013 3 次提交
  6. 03 7月, 2013 11 次提交
  7. 28 4月, 2013 1 次提交
  8. 26 4月, 2013 2 次提交
  9. 20 4月, 2013 2 次提交
    • X
      if singletons belong to the contract, test them · 0400a7ff
      Xavier Noria 提交于
      Object#respond_to? returns singletons and thus we inherit that contract.
      The implementation of the predicate is good, but the test is only
      checking boolean semantics, which in this case is not enough.
      0400a7ff
    • N
      fix respond_to? for non selected column · 66001f36
      Neeraj Singh 提交于
      fixes #4208
      
      If a query selects only a few columns and gives custom names to
      those columns then respond_to? was returning true for the non
      selected columns. However calling those non selected columns
      raises exception.
      
          post = Post.select("'title' as post_title").first
      
      In the above case when `post.body` is invoked then an exception is
      raised since `body` attribute is not selected. Howevere `respond_to?`
      did not behave correctly.
      
          pos.respond_to?(:body) #=> true
      
      Reason was that Active Record calls `super` to pass the call to
      Active Model and all the columns are defined on Active Model.
      
      Fix is to actually check if the data returned from the db contains
      the data for column in question.
      66001f36
  10. 27 3月, 2013 1 次提交
  11. 22 3月, 2013 1 次提交
  12. 19 3月, 2013 1 次提交
  13. 10 11月, 2012 1 次提交
  14. 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
  15. 26 10月, 2012 1 次提交
    • J
      Remove ActiveRecord::Model · 9e4c41c9
      Jon Leighton 提交于
      In the end I think the pain of implementing this seamlessly was not
      worth the gain provided.
      
      The intention was that it would allow plain ruby objects that might not
      live in your main application to be subclassed and have persistence
      mixed in. But I've decided that the benefit of doing that is not worth
      the amount of complexity that the implementation introduced.
      9e4c41c9
  16. 22 10月, 2012 3 次提交
  17. 21 10月, 2012 1 次提交
  18. 29 9月, 2012 1 次提交
    • J
      Support for partial inserts. · 144e8691
      Jon Leighton 提交于
      When inserting new records, only the fields which have been changed
      from the defaults will actually be included in the INSERT statement.
      The other fields will be populated by the database.
      
      This is more efficient, and also means that it will be safe to
      remove database columns without getting subsequent errors in running
      app processes (so long as the code in those processes doesn't
      contain any references to the removed column).
      144e8691
  19. 03 8月, 2012 1 次提交
  20. 16 6月, 2012 1 次提交
  21. 09 6月, 2012 2 次提交
  22. 28 3月, 2012 1 次提交
  23. 07 3月, 2012 1 次提交