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