1. 03 9月, 2016 1 次提交
  2. 31 8月, 2016 1 次提交
    • S
      Override `respond_to_missing?` instead of `respond_to?` when possible · 03d3f036
      Sean Griffin 提交于
      This was almost every case where we are overriding `respond_to?` in a
      way that mirrors a parallel implementation of `method_missing`. There is
      one remaining case in Active Model that should probably do the same
      thing, but had a sufficiently strange implementation that I want to
      investigate it separately.
      
      Fixes #26333.
      03d3f036
  3. 07 8月, 2016 2 次提交
  4. 25 7月, 2016 1 次提交
  5. 24 7月, 2016 1 次提交
  6. 09 9月, 2015 1 次提交
  7. 09 5月, 2015 1 次提交
  8. 02 1月, 2015 1 次提交
  9. 30 1月, 2014 1 次提交
    • G
      Fixed a bug in AR::Base#respond_to? · 9ed66648
      Godfrey Chan 提交于
      Before:
      
        >> ActiveRecord::Base.respond_to?(:find_by_something)
        NoMethodError: undefined method `abstract_class?' for Object:Class
      
      After:
      
        >> ActiveRecord::Base.respond_to?(:find_by_something)
        => false
      9ed66648
  10. 11 12月, 2013 1 次提交
    • L
      Prevent invalid code when using dynamic finders with Ruby's reserved words. · 23ce3e5f
      Lauro Caetano 提交于
      The dynamic finder was creating the method signature with the parameters name,
      which may have reserved words and this way creating invalid Ruby code.
      
      Closes: #13261
      
          Example:
      
              # Before
              Dog.find_by_alias('dog name')
      
              # Was creating this method
              def self.find_by_alias(alias, options = {})
      
              # After
              Dog.find_by_alias('dog name')
      
              # Will create this method
              def self.find_by_alias(_alias, options = {})
      23ce3e5f
  11. 22 8月, 2013 1 次提交
  12. 26 2月, 2013 2 次提交
  13. 17 8月, 2012 1 次提交
  14. 28 7月, 2012 1 次提交
  15. 22 6月, 2012 1 次提交
  16. 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
  17. 04 5月, 2012 6 次提交
  18. 03 3月, 2012 1 次提交
    • C
      Refactor and cleanup in some ActiveRecord modules · 50725cec
      Carlos Antonio da Silva 提交于
      * Avoid double hash lookups in AR::Reflection when reflecting associations/aggregations
      * Minor cleanups: use elsif, do..end, if..else instead of unless..else
      * Simplify DynamicMatchers#respond_to?
      * Use "where" instead of scoped with conditions hash
      * Extract `scoped_by` method pattern regexp to constant
      * Extract noisy class_eval from method_missing in dynamic matchers
      * Extract readonly check, avoid calling column#to_s twice in persistence
      * Refactor predicate builder, remove some variables
      50725cec
  19. 28 1月, 2012 1 次提交
  20. 27 1月, 2012 1 次提交
    • P
      Fix regression from Rails 3.1 · 7b9baeed
      Paul McMahon 提交于
      Under Rails 3.1, you were allowed to pass a hash to a find_or_create
      method with multiple attribute names, but this was broken as the
      arguments were being improperly validated.
      7b9baeed
  21. 16 12月, 2011 1 次提交