module NillyVanilly::Nillify::InstanceMethods

Public Instance Methods

nillification() click to toggle source

Nillify attribute if it is a empty string

# File lib/nilly_vanilly/nillify.rb, line 26
def nillification
  for attribute in self.class.nillify_attributes
    self.send("#{attribute}=", nil) if self.send(attribute) == ""
  end
end