# File lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb, line 6 def initialize(subject, name) @subject = subject @name = name end
# File lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb, line 19 def model_class subject.class end
# File lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb, line 27 def option_set_properly?(option, option_key) option.to_s == option_string(option_key) end
# File lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb, line 23 def option_string(key) reflection.options[key].to_s end
# File lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb, line 15 def reflect_on_association(name) model_class.reflect_on_association(name) end
# File lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb, line 11 def reflection @reflection ||= reflect_on_association(name) end