# File lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb, line 8 def initialize(counter_cache, name) @counter_cache = counter_cache @name = name @missing_option = '' end
# File lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb, line 14 def description "counter_cache => #{counter_cache}" end
# File lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb, line 18 def matches?(subject) subject = ModelReflector.new(subject, name) if subject.option_set_properly?(counter_cache, :counter_cache) true else self.missing_option = "#{name} should have #{description}" false end end