class Shoulda::Matchers::ActiveRecord::HaveReadonlyAttributeMatcher
def matches?(subject)
def matches?(subject) @subject = subject if readonly_attributes.include?(@attribute) @failure_message_for_should_not = "Did not expect #{@attribute} to be read-only" true else if readonly_attributes.empty? @failure_message_for_should = "#{class_name} attribute #{@attribute} " << 'is not read-only' else @failure_message_for_should = "#{class_name} is making " << "#{readonly_attributes.to_a.to_sentence} " << "read-only, but not #{@attribute}." end false end end