module DogBiscuits::Actors::SingularAttributes

Public Instance Methods

clean_attributes(attributes) click to toggle source

Override the BaseActor clean_attributes method to apply this to all configured singular properties Cast any singular values from the form to multiple values for persistence

Calls superclass method
# File lib/dog_biscuits/actors/singular_attributes.rb, line 8
def clean_attributes(attributes)
  DogBiscuits.config.singular_properties.each do |prop|
    next if attributes[prop].blank?
    attributes[prop] = Array.wrap(attributes[prop]) if attributes.key? prop
  end
  super
end