Property

Constants

Methods

#[]

Returning nil when we get ActiveAttr::UnknownAttributeError from ActiveAttr

def read_attribute(name)
  super(name)
rescue ActiveAttr::UnknownAttributeError
  nil
end
#_persisted_obj

Returns the value of attribute _persisted_obj

def _persisted_obj
  @_persisted_obj
end

#initialize

def initialize(attributes = nil)
  super(attributes)
  @attributes ||= Hash[self.class.attributes_nil_hash]

  send_props(@relationship_props) if _persisted_obj && !@relationship_props.nil?
end
#read_attribute

Returning nil when we get ActiveAttr::UnknownAttributeError from ActiveAttr

def read_attribute(name)
  super(name)
rescue ActiveAttr::UnknownAttributeError
  nil
end

#send_props

def send_props(hash)
  return hash if hash.blank?
  hash.each { |key, value| self.send("#{key}=", value) }
end