Created
September 26, 2011 04:38
-
-
Save mikebannister/1241624 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Importable | |
module Validatable | |
extend ActiveSupport::Concern | |
included do | |
include ActiveModel::Validations | |
include ActiveModel::Serialization | |
attr_accessor :attributes | |
end | |
module InstanceMethod | |
def initialize(attributes = {}) | |
@attributes = attributes | |
end | |
def read_attribute_for_validation(key) | |
@attributes[key] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment