Exception: Madoka::ModelInvalid

Inherits:
StandardError
  • Object
show all
Defined in:
lib/madoka/model_invalid.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ ModelInvalid

Returns a new instance of ModelInvalid.



4
5
6
7
8
# File 'lib/madoka/model_invalid.rb', line 4

def initialize(model)
  @model = model
  errors = @model.errors.full_messages.join(", ")
  super(I18n.t("activerecord.errors.messages.record_invalid", :errors => errors))
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/madoka/model_invalid.rb', line 3

def model
  @model
end