Guest User

Untitled

a guest
Jan 21st, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. module Importable
  2. module Validatable
  3. extend ActiveSupport::Concern
  4.  
  5. included do
  6. include ActiveModel::Validations
  7. include ActiveModel::Serialization
  8.  
  9. attr_accessor :attributes
  10. end
  11.  
  12. module InstanceMethod
  13. def initialize(attributes = {})
  14. @attributes = attributes
  15. end
  16.  
  17. def read_attribute_for_validation(key)
  18. @attributes[key]
  19. end
  20. end
  21. end
  22. end
Add Comment
Please, Sign In to add comment