Sha256: eda1e97afa0c38ae1eeb72d10fc081774dffeecf7ece86f952e96a906f84b3d3

Contents?: true

Size: 426 Bytes

Versions: 19

Compression:

Stored size: 426 Bytes

Contents

class BMC::MiniFormObject < SimpleDelegator
  include ActiveModel::Validations
  extend Forwardable

  def valid?
    __getobj__.valid?
    run_validations!
  end

  def invalid?
    !valid?
  end

  alias validate valid?

  def validate!
    valid? || raise_validation_error
  end

  def_delegators :__getobj__, :errors

  def save
    valid? && __getobj__.save
  end

  def save!
    validate! && __getobj__.save!
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
bmc-1.6.1 app/forms/bmc/mini_form_object.rb
bmc-1.6.0 app/forms/bmc/mini_form_object.rb
bmc-1.5.1 app/forms/bmc/mini_form_object.rb
bmc-1.5.0 app/forms/bmc/mini_form_object.rb
bmc-1.4.3 app/forms/bmc/mini_form_object.rb
bmc-1.4.2 app/forms/bmc/mini_form_object.rb
bmc-1.4.1 app/forms/bmc/mini_form_object.rb
bmc-1.4.0 app/forms/bmc/mini_form_object.rb
bmc-1.3.5 app/forms/bmc/mini_form_object.rb
bmc-1.3.4 app/forms/bmc/mini_form_object.rb
bmc-1.3.3 app/forms/bmc/mini_form_object.rb
bmc-1.3.2 app/forms/bmc/mini_form_object.rb
bmc-1.3.1 app/forms/bmc/mini_form_object.rb
bmc-1.3.0 app/forms/bmc/mini_form_object.rb
bmc-1.2.1 app/forms/bmc/mini_form_object.rb
bmc-1.2.0 app/forms/bmc/mini_form_object.rb
bmc-1.1.0 app/forms/bmc/mini_form_object.rb
bmc-1.0.1 app/forms/bmc/mini_form_object.rb
bmc-1.0.0 app/forms/bmc/mini_form_object.rb