Method: ActiveData::Model::Attributes::Reflections::Base#type

Defined in:
lib/active_data/model/attributes/reflections/base.rb

#typeObject



33
34
35
36
37
38
39
40
41
42
# File 'lib/active_data/model/attributes/reflections/base.rb', line 33

def type
  @type ||= case options[:type]
  when Class, Module
    options[:type]
  when nil
    raise "Type is not specified for `#{name}`"
  else
    options[:type].to_s.camelize.constantize
  end
end