Module: Rein::Constraint::Presence

Includes:
ActiveRecord::ConnectionAdapters::Quoting
Included in:
ActiveRecord::Migration
Defined in:
lib/rein/constraint/presence.rb

Overview

This module contains methods for defining presence constraints.

Instance Method Summary collapse

Instance Method Details

#add_presence_constraint(*args) ⇒ Object



9
10
11
12
13
14
# File 'lib/rein/constraint/presence.rb', line 9

def add_presence_constraint(*args)
  reversible do |dir|
    dir.up { _add_presence_constraint(*args) }
    dir.down { _remove_presence_constraint(*args) }
  end
end

#remove_presence_constraint(*args) ⇒ Object



16
17
18
19
20
21
# File 'lib/rein/constraint/presence.rb', line 16

def remove_presence_constraint(*args)
  reversible do |dir|
    dir.up { _remove_presence_constraint(*args) }
    dir.down { _add_presence_constraint(*args) }
  end
end