Object
@private
# File lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb, line 24 def association_set_properly? through_association_exists? && through_association_correct? end
# File lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb, line 15 def description "through #{through}" end
# File lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb, line 19 def matches?(subject) self.subject = ModelReflector.new(subject, name) through.nil? || association_set_properly? end
# File lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb, line 41 def through_association_correct? if option_verifier.correct_for_string?(:through, through) true else self.missing_option = "Expected #{name} to have #{name} through #{through}, " + "but got it through #{option_verifier.actual_value_for(:through)}" false end end
# File lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb, line 28 def through_association_exists? if through_reflection.present? true else self.missing_option = "#{name} does not have any relationship to #{through}" false end end
Generated with the Darkfish Rdoc Generator 2.