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.58 spec/dummy/app/models/role.rb
awesome_translations-0.0.57 spec/dummy/app/models/role.rb
awesome_translations-0.0.56 spec/dummy/app/models/role.rb
awesome_translations-0.0.55 spec/dummy/app/models/role.rb
awesome_translations-0.0.54 spec/dummy/app/models/role.rb
awesome_translations-0.0.53 spec/dummy/app/models/role.rb
awesome_translations-0.0.52 spec/dummy/app/models/role.rb
awesome_translations-0.0.51 spec/dummy/app/models/role.rb
awesome_translations-0.0.50 spec/dummy/app/models/role.rb
awesome_translations-0.0.49 spec/dummy/app/models/role.rb
awesome_translations-0.0.48 spec/dummy/app/models/role.rb
awesome_translations-0.0.47 spec/dummy/app/models/role.rb
awesome_translations-0.0.46 spec/dummy/app/models/role.rb
awesome_translations-0.0.45 spec/dummy/app/models/role.rb
awesome_translations-0.0.44 spec/dummy/app/models/role.rb
awesome_translations-0.0.43 spec/dummy/app/models/role.rb
awesome_translations-0.0.42 spec/dummy/app/models/role.rb
awesome_translations-0.0.41 spec/dummy/app/models/role.rb
awesome_translations-0.0.40 spec/dummy/app/models/role.rb
awesome_translations-0.0.39 spec/dummy/app/models/role.rb