method
counter_cache_column
v6.0.0 -
Show latest stable
- Class:
ActiveRecord::Reflection::AbstractReflection
counter_cache_column()public
No documentation available.
# File activerecord/lib/active_record/reflection.rb, line 219
def counter_cache_column
if belongs_to?
if options[:counter_cache] == true
"#{active_record.name.demodulize.underscore.pluralize}_count"
elsif options[:counter_cache]
options[:counter_cache].to_s
end
else
options[:counter_cache] ? options[:counter_cache].to_s : "#{name}_count"
end
end