Class: Reform::Contract

Inherits:
Object
  • Object
show all
Extended by:
Forwardable, PropertyMethods, 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.



90
91
92
# File 'lib/reform/contract.rb', line 90

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.



82
83
84
# File 'lib/reform/contract.rb', line 82

def model
  @model
end