mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fixed that :counter_cache option would look for a line_items_count column for a LineItem object instead of lineitems_count
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@989 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Fixed that :counter_cache option would look for a line_items_count column for a LineItem object instead of lineitems_count
|
||||
|
||||
* Fixed that AR exists?() would explode on postgresql if the passed id did not match the PK type #900 [Scott Barron]
|
||||
|
||||
* Fixed the MS SQL adapter to work with the new limit/offset approach and with binary data (still suffering from 7KB limit, though) #901 [delynnb]
|
||||
|
||||
@@ -376,12 +376,12 @@ module ActiveRecord
|
||||
|
||||
if options[:counter_cache]
|
||||
module_eval(
|
||||
"after_create '#{association_class_name}.increment_counter(\"#{Inflector.pluralize(self.to_s.downcase). + "_count"}\", #{association_class_primary_key_name})" +
|
||||
"after_create '#{association_class_name}.increment_counter(\"#{self.to_s.underscore.pluralize + "_count"}\", #{association_class_primary_key_name})" +
|
||||
" unless #{association_name}.nil?'"
|
||||
)
|
||||
|
||||
module_eval(
|
||||
"before_destroy '#{association_class_name}.decrement_counter(\"#{Inflector.pluralize(self.to_s.downcase) + "_count"}\", #{association_class_primary_key_name})" +
|
||||
"before_destroy '#{association_class_name}.decrement_counter(\"#{self.to_s.underscore.pluralize + "_count"}\", #{association_class_primary_key_name})" +
|
||||
" unless #{association_name}.nil?'"
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user