Ticket #6225: 6226_fix_deprecated_foo_count.diff
| File 6226_fix_deprecated_foo_count.diff, 0.8 kB (added by octopod, 2 years ago) |
|---|
-
activerecord/lib/active_record/deprecated_associations.rb
old new 4 4 def deprecated_collection_count_method(collection_name)# :nodoc: 5 5 module_eval <<-"end_eval", __FILE__, __LINE__ 6 6 def #{collection_name}_count(force_reload = false) 7 unless has_attribute?(:#{collection_name}_count) 7 unless has_attribute?(:#{collection_name}_count) or respond_to?(:#{collection_name}_count) 8 8 ActiveSupport::Deprecation.warn :#{collection_name}_count 9 9 end 10 10 #{collection_name}.reload if force_reload