Sha256: 764553846cf4096c55daf1e2f9067c7338e58824f3db6701e0bd4ab5ac62a017

Contents?: true

Size: 327 Bytes

Versions: 33

Compression:

Stored size: 327 Bytes

Contents

class Role < ActiveRecord::Base
  translates :name

  belongs_to :user

  validates :user, :role, presence: true

  monetize :price_cents, allow_nil: true

  def self.roles
    {
      t(".administrator") => "admin",
      t(".moderator") => "moderator"
    }
  end

  def self.roles_array
    [[t(".user"), "user"]]
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
awesome_translations-0.0.38 spec/dummy/app/models/role.rb
awesome_translations-0.0.37 spec/dummy/app/models/role.rb
awesome_translations-0.0.36 spec/dummy/app/models/role.rb
awesome_translations-0.0.35 spec/dummy/app/models/role.rb
awesome_translations-0.0.34 spec/dummy/app/models/role.rb
awesome_translations-0.0.33 spec/dummy/app/models/role.rb
awesome_translations-0.0.32 spec/dummy/app/models/role.rb
awesome_translations-0.0.31 spec/dummy/app/models/role.rb
awesome_translations-0.0.30 spec/dummy/app/models/role.rb
awesome_translations-0.0.29 spec/dummy/app/models/role.rb
awesome_translations-0.0.28 spec/dummy/app/models/role.rb
awesome_translations-0.0.27 spec/dummy/app/models/role.rb
awesome_translations-0.0.26 spec/dummy/app/models/role.rb