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