Sha256: 99f2279c5ea84f77a970d9e292ea600c24c3d9e2eb19344429dd52c42e087e0a

Contents?: true

Size: 408 Bytes

Versions: 55

Compression:

Stored size: 408 Bytes

Contents

# Validates Arm model.
class ArmValidator < ActiveModel::Validator
  def validate(record)
    if ActiveRecord::Base.connection
       .column_exists?(:arms, :can_message_after_membership_complete) &&
       record.can_message_after_membership_complete.nil?
      record.errors[:base] << "An Arm must have a value for can_message"\
                              "_after_membership_complete"
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
think_feel_do_engine-3.12.7 app/models/arm_validator.rb
think_feel_do_engine-3.12.6 app/models/arm_validator.rb
think_feel_do_engine-3.12.5 app/models/arm_validator.rb
think_feel_do_engine-3.12.4 app/models/arm_validator.rb
think_feel_do_engine-3.12.3 app/models/arm_validator.rb
think_feel_do_engine-3.12.2 app/models/arm_validator.rb
think_feel_do_engine-3.12.1 app/models/arm_validator.rb
think_feel_do_engine-3.12.0 app/models/arm_validator.rb
think_feel_do_engine-3.11.3 app/models/arm_validator.rb
think_feel_do_engine-3.11.0 app/models/arm_validator.rb
think_feel_do_engine-3.10.10 app/models/arm_validator.rb
think_feel_do_engine-3.10.9 app/models/arm_validator.rb
think_feel_do_engine-3.10.8 app/models/arm_validator.rb
think_feel_do_engine-3.10.7 app/models/arm_validator.rb
think_feel_do_engine-3.10.6 app/models/arm_validator.rb