method
counter_cache_column
v7.2.3 -
Show latest stable
- Class:
ActiveRecord::Reflection::AbstractReflection
counter_cache_column()public
No documentation available.
# File activerecord/lib/active_record/reflection.rb, line 244
def counter_cache_column
@counter_cache_column ||= begin
counter_cache = options[:counter_cache]
if belongs_to?
if counter_cache
counter_cache[:column] || -"#{active_record.name.demodulize.underscore.pluralize}_count"
end
else
-((counter_cache && -counter_cache[:column]) || "#{name}_count")
end
end
end