Sha256: c1b11286238c2db2a62eee06923b6d9cba3a66ab760314056270f5844c8bb130

Contents?: true

Size: 431 Bytes

Versions: 65

Compression:

Stored size: 431 Bytes

Contents

class Agilibox::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

65 entries across 65 versions & 1 rubygems

Version Path
agilibox-2.0.0 app/forms/agilibox/mini_form_object.rb
agilibox-1.11.0 app/forms/agilibox/mini_form_object.rb
agilibox-1.10.5 app/forms/agilibox/mini_form_object.rb
agilibox-1.10.2 app/forms/agilibox/mini_form_object.rb
agilibox-1.10.1 app/forms/agilibox/mini_form_object.rb
agilibox-1.10.0 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.20 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.19 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.18 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.17 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.16 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.15 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.14 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.13 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.12 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.11 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.10 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.9 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.8 app/forms/agilibox/mini_form_object.rb
agilibox-1.9.7 app/forms/agilibox/mini_form_object.rb