Class: Reform::Contract

Inherits:
Object
  • Object
show all
Extended by:
PropertyMethods, Uber::Delegates, Uber::InheritableAttr
Includes:
ActiveModel::Validations, Setup, Validate
Defined in:
lib/reform/contract.rb,
lib/reform/contract/setup.rb

Overview

Gives you a DSL for defining the object structure and its validations.

Direct Known Subclasses

Form

Defined Under Namespace

Modules: PropertyMethods, Setup, Validate Classes: Errors, Fields

Constant Summary collapse

RESERVED_METHODS =

TODO: refactor that so we don’t need that.

[:model, :aliased_model, :fields, :mapper]

Instance Attribute Summary collapse

Method Summary

Methods included from PropertyMethods

collection, properties, property, setup_form_definition

Methods included from Validate

#validate, #validate!

Methods included from Setup

#create_fields, #initialize, #setup_fields

Instance Attribute Details

#errorsObject

FIXME: this is needed for Rails 3.0 compatibility.



95
96
97
# File 'lib/reform/contract.rb', line 95

def errors # FIXME: this is needed for Rails 3.0 compatibility.
  @errors ||= Errors.new(self)
end

#modelObject Also known as: aliased_model

Returns the value of attribute model.



87
88
89
# File 'lib/reform/contract.rb', line 87

def model
  @model
end