1. 29 1月, 2013 1 次提交
  2. 18 1月, 2013 1 次提交
    • X
      iterates the RDoc of update_column(s) · f71467ac
      Xavier Noria 提交于
      This revision makes crystal clear that the methods go
      straight to the database and update the receiver. It
      also adds and example, and removes the duplication
      in the singular and plural forms by referring one to
      the other.
      f71467ac
  3. 04 1月, 2013 2 次提交
  4. 07 12月, 2012 1 次提交
    • C
      Unscope update_column(s) query to ignore default scope · 0e67f793
      Carlos Antonio da Silva 提交于
      When applying default_scope to a class with a where clause, using
      update_column(s) could generate a query that would not properly update
      the record due to the where clause from the default_scope being applied
      to the update query.
      
          class User < ActiveRecord::Base
            default_scope where(active: true)
          end
      
          user = User.first
          user.active = false
          user.save!
      
          user.update_column(:active, true) # => false
      
      In this situation we want to skip the default_scope clause and just
      update the record based on the primary key. With this change:
      
          user.update_column(:active, true) # => true
      
      Fixes #8436.
      0e67f793
  5. 29 11月, 2012 2 次提交
  6. 21 11月, 2012 1 次提交
  7. 19 11月, 2012 1 次提交
  8. 17 11月, 2012 1 次提交
  9. 29 10月, 2012 1 次提交
  10. 23 10月, 2012 1 次提交
  11. 11 10月, 2012 2 次提交
  12. 05 10月, 2012 1 次提交
  13. 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
  14. 19 9月, 2012 1 次提交
  15. 17 9月, 2012 2 次提交
  16. 03 9月, 2012 1 次提交
    • Y
      set the configured #inheritance_column on #become (#7503) · 20574956
      Yves Senn 提交于
      I had to create a new table because I needed an STI table,
      which does not have both a "type" and a "custom_type"
      
      the test fails with:
        1) Error:
      test_alt_becomes_works_with_sti(InheritanceTest):
      NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber">
          /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing'
          /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing'
          /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes'
          test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti'
          test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'
      20574956
  17. 26 8月, 2012 3 次提交
  18. 20 8月, 2012 1 次提交
    • C
      Remove private verify readonly attr method · 7a8aee08
      Carlos Antonio da Silva 提交于
      This method was added to be shared between update_attribute and
      update_column in 50725cec, but since
      update_attribute was removed, and update_column has changed to delegate
      to update_columns, the method is not used anywhere anymore.
      
      Also remove "key.to_s" conversion when raising readonly error, since
      the key is being interpolated.
      7a8aee08
  19. 03 8月, 2012 1 次提交
  20. 30 7月, 2012 1 次提交
  21. 28 7月, 2012 1 次提交
  22. 25 7月, 2012 3 次提交
  23. 19 6月, 2012 1 次提交
    • S
      Removing composed_of from ActiveRecord. · 14fc8b34
      Steve Klabnik 提交于
      This feature adds a lot of complication to ActiveRecord for dubious
      value. Let's talk about what it does currently:
      
      class Customer < ActiveRecord::Base
        composed_of :balance, :class_name => "Money", :mapping => %w(balance amount)
      end
      
      Instead, you can do something like this:
      
          def balance
            @balance ||= Money.new(value, currency)
          end
      
          def balance=(balance)
            self[:value] = balance.value
            self[:currency] = balance.currency
            @balance = balance
          end
      
      Since that's fairly easy code to write, and doesn't need anything
      extra from the framework, if you use composed_of today, you'll
      have to add accessors/mutators like that.
      
      Closes #1436
      Closes #2084
      Closes #3807
      14fc8b34
  24. 15 6月, 2012 1 次提交
  25. 07 6月, 2012 1 次提交
  26. 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
  27. 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
  28. 17 5月, 2012 1 次提交
  29. 30 4月, 2012 2 次提交
  30. 26 4月, 2012 1 次提交
  31. 30 3月, 2012 1 次提交