Module: Iry::Constraint Abstract
- Defined in:
- lib/iry/constraint.rb,
lib/iry/constraint/check.rb,
lib/iry/constraint/unique.rb,
lib/iry/constraint/exclusion.rb,
lib/iry/constraint/foreign_key.rb
Overview
This module is abstract.
Interface representing a constraint. A constraint has a name and can apply errors to an object inheriting from ActiveRecord::Base
Defined Under Namespace
Classes: Check, Exclusion, ForeignKey, Unique
Instance Method Summary collapse
-
#apply(model) ⇒ ActiveModel::Error
abstract
Sets validation errors on the model.
-
#message ⇒ Symbol, String
abstract
Message to be attached as validation error to the model (see Handlers::Model).
-
#name ⇒ String
abstract
Name of the constraint to be caught from the database.
Instance Method Details
#apply(model) ⇒ ActiveModel::Error
This method is abstract.
Sets validation errors on the model
10 11 |
# File 'lib/iry/constraint.rb', line 10 def apply(model) end |
#message ⇒ Symbol, String
This method is abstract.
Message to be attached as validation error to the model (see Handlers::Model)
23 24 |
# File 'lib/iry/constraint.rb', line 23 def end |
#name ⇒ String
This method is abstract.
Name of the constraint to be caught from the database
16 17 |
# File 'lib/iry/constraint.rb', line 16 def name end |