Displaying 1 result from an estimated 1 matches for "has_cached_total".
2006 Mar 13
1
adding custom cache field
...ze + "_total"}\",#{association_primary_key}_type,-#{options[:total_cache]})" +
" unless #{association_type}.nil?''"
)
end
end
end
class AssociationCollection
def total
count = if has_cached_total?
@owner.send(:read_attribute,cached_total_attribute_name)
end
end
def has_cached_total?
@owner.attribute_present?(cached_total_attribute_name)
end
def cached_total_attribute_name
"#{@reflection.name}_total"...