Class: StoreModel::Types::Many

Inherits:
ManyBase
  • Object
show all
Defined in:
lib/store_model/types/many.rb

Overview

Implements ActiveModel::Type::Value type for handling an array of StoreModel::Model

Instance Method Summary collapse

Methods inherited from ManyBase

#cast_value, #changed_in_place?, #serialize

Constructor Details

#initialize(model_klass) ⇒ StoreModel::Types::Many

Initializes type for model class

Parameters:



15
16
17
# File 'lib/store_model/types/many.rb', line 15

def initialize(model_klass)
  @model_klass = model_klass
end

Instance Method Details

#typeSymbol

Returns type

Returns:

  • (Symbol)


22
23
24
# File 'lib/store_model/types/many.rb', line 22

def type
  :array
end