Sha256: 73d7bda7532002ed84936505a7beeeccbbafb5d805318d6cd0b94af47fc97fb5

Contents?: true

Size: 326 Bytes

Versions: 13

Compression:

Stored size: 326 Bytes

Contents

require 'enumerated_attribute'
class User < ActiveRecord::Base
  validates_presence_of :first_name, :gender, :age, :status, :degree
  validates_numericality_of :age
  
  enum_attr :gender, %w(male female)
  enum_attr :status, %w(single married divorced widowed)
  enum_attr :degree, %w(^none high_school college graduate)
end

Version data entries

13 entries across 12 versions & 3 rubygems

Version Path
jeffp-enumerated_attribute-0.2.0.2 spec/rails/app/models/user.rb
jeffp-enumerated_attribute-0.2.1 spec/rails/app/models/user.rb
jeffp-enumerated_attribute-0.2.2 spec/rails/app/models/user.rb
jeffp-enumerated_attribute-0.2.3 spec/rails/app/models/user.rb
edave-enumerated_attribute-0.2.18 spec/rails/app/models/user.rb
enumerated_attribute-0.2.16 spec/rails/app/models/user.rb
enumerated_attribute-0.2.16 spec/rails3/app/models/user.rb
enumerated_attribute-0.2.13 spec/rails/app/models/user.rb
enumerated_attribute-0.2.12 spec/rails/app/models/user.rb
enumerated_attribute-0.2.11 spec/rails/app/models/user.rb
enumerated_attribute-0.2.10 spec/rails/app/models/user.rb
enumerated_attribute-0.2.8 spec/rails/app/models/user.rb
enumerated_attribute-0.2.7 spec/rails/app/models/user.rb