Module: Protobuf::ActiveRecord::MassAssignmentSecurity

Extended by:
ActiveSupport::Concern
Defined in:
lib/protobuf/active_record/mass_assignment_security.rb,
lib/protobuf/active_record/mass_assignment_security/persistence.rb,
lib/protobuf/active_record/mass_assignment_security/transformation.rb

Defined Under Namespace

Modules: Persistence, Transformation

Instance Method Summary collapse

Instance Method Details

#initialize(*args, &block) ⇒ Object

Override Active Record’s initialize method so it can accept a protobuf message as it’s attributes. :noapi:



50
51
52
53
54
# File 'lib/protobuf/active_record/mass_assignment_security/persistence.rb', line 50

def initialize(*args, &block)
  args[0] = attributes_from_proto(args.first) if args.first.is_a?(::Protobuf::Message)

  super(*args, &block)
end