Module: ActiveModel::Validations::HelperMethods

Defined in:
lib/active_model/validations/helper_methods.rb

Instance Method Summary collapse

Instance Method Details

#validate_state_history(association, options = {}) ⇒ Object



15
16
17
18
19
# File 'lib/active_model/validations/helper_methods.rb', line 15

def validate_state_history(association, options = {})
  params = { :association => association }
  params.merge!(options)
  validates_with StateHistoryValidator, params
end

#validate_state_history_entry(options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/active_model/validations/helper_methods.rb', line 7

def validate_state_history_entry(options = {})
  start_attr = options[:start] || :start
  validates start_attr, :presence => true

  validates_with StateHistoryEntryValidator, options
end