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