Sha256: 79fc8395da419a55259c100cc421e80fddd8fb404fac62994ea02b397371559f

Contents?: true

Size: 433 Bytes

Versions: 26

Compression:

Stored size: 433 Bytes

Contents

class Marty::RoleType < Marty::Base
  extend Marty::PgEnum

  VALUES = [
    'admin',
    'user_manager',
    'dev',
    'viewer',
    'data_grid_editor'
  ]

  def self.from_nice_names(roles)
    Marty::RoleType.get_all.select do |role|
      roles.include?(I18n.t("roles.#{role}", default: role))
    end
  end

  def self.to_nice_names(roles)
    roles.map do |role|
      I18n.t("roles.#{role}", default: role)
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
marty-14.3.0 app/models/marty/role_type.rb
marty-14.0.0 app/models/marty/role_type.rb
marty-13.0.2 app/models/marty/role_type.rb
marty-11.0.0 app/models/marty/role_type.rb
marty-10.0.3 app/models/marty/role_type.rb
marty-10.0.2 app/models/marty/role_type.rb
marty-10.0.0 app/models/marty/role_type.rb
marty-9.5.1 app/models/marty/role_type.rb
marty-9.5.0 app/models/marty/role_type.rb
marty-9.3.3 app/models/marty/role_type.rb
marty-9.3.2 app/models/marty/role_type.rb
marty-9.3.0 app/models/marty/role_type.rb
marty-8.5.0 app/models/marty/role_type.rb
marty-8.4.1 app/models/marty/role_type.rb
marty-8.3.1 app/models/marty/role_type.rb
marty-8.2.0 app/models/marty/role_type.rb
marty-8.0.0 app/models/marty/role_type.rb
marty-6.1.0 app/models/marty/role_type.rb
marty-5.2.0 app/models/marty/role_type.rb
marty-5.1.4 app/models/marty/role_type.rb