One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| require "rspec/expectations" | |
| RSpec::Matchers.define :allow_content_type do |*content_types| | |
| match do |record| | |
| matcher.matches?(record, content_types) | |
| end | |
| chain :for do |attr_name| | |
| matcher.for(attr_name) | |
| end |
| class AttachedValidator < ActiveModel::EachValidator | |
| def validate_each(record, attribute, value) | |
| record.errors.add(attribute, :attached, options) unless value.attached? | |
| end | |
| end |