Module: Protoable::Persistence::ClassMethods

Defined in:
lib/protobuf/activerecord/protoable/persistence.rb

Instance Method Summary collapse

Instance Method Details

#create(attributes, options = {}, &block) ⇒ Object

:nodoc:



21
22
23
24
25
# File 'lib/protobuf/activerecord/protoable/persistence.rb', line 21

def create(attributes, options = {}, &block)
  attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message)

  super(attributes, options)
end

#create!(attributes, options = {}, &block) ⇒ Object

:nodoc:



28
29
30
31
32
# File 'lib/protobuf/activerecord/protoable/persistence.rb', line 28

def create!(attributes, options = {}, &block)
  attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message)

  super(attributes, options)
end