Sha256: 3ba2ce6b9add072c0c9e1865aeedce34cad32c229ad9132e4928194b80b60739

Contents?: true

Size: 258 Bytes

Versions: 11

Compression:

Stored size: 258 Bytes

Contents

class StripeTypeValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    if value.nil? || !value.in?( %w(individual corporation) )
      record.errors[attribute] << "must specify either individual or corporate"
		end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
stripe_local-0.2.5 app/validators/stripe_type_validator.rb
stripe_local-0.2.4 app/validators/stripe_type_validator.rb
stripe_local-0.2.3 app/validators/stripe_type_validator.rb
stripe_local-0.2.2 app/validators/stripe_type_validator.rb
stripe_local-0.2.1 app/validators/stripe_type_validator.rb
stripe_local-0.2.0 app/validators/stripe_type_validator.rb
stripe_local-0.1.3 app/validators/stripe_type_validator.rb
stripe_local-0.1.2 app/validators/stripe_type_validator.rb
stripe_local-0.1.1 app/validators/stripe_type_validator.rb
stripe_local-0.1.0 app/validators/stripe_type_validator.rb
stripe_local-0.0.2 app/validators/stripe_type_validator.rb