Module: Protobuf::Mongoid::Persistence::ClassMethods
- Defined in:
- lib/protobuf/mongoid/persistence.rb
Overview
Class Methods
Instance Method Summary collapse
-
#create(attributes = {}, &block) ⇒ Object
:nodoc:.
-
#create!(attributes = {}, &block) ⇒ Object
:nodoc:.
Instance Method Details
#create(attributes = {}, &block) ⇒ Object
:nodoc:
14 15 16 17 18 |
# File 'lib/protobuf/mongoid/persistence.rb', line 14 def create(attributes = {}, &block) attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message) super(attributes, &block) end |
#create!(attributes = {}, &block) ⇒ Object
:nodoc:
21 22 23 24 25 |
# File 'lib/protobuf/mongoid/persistence.rb', line 21 def create!(attributes = {}, &block) attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message) super(attributes, &block) end |