<commit_before># == Schema Information
#
# Table name: roles
#
#  id         :integer          not null, primary key
#  name       :string(255)
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

#
# == UserRole Model
# - Handle role for a user (admin, ...)
#
class Role < ActiveRecord::Base
  has_many :users

  scope :except_super_adminstrator, -> { where.not(name: 'super_administrator') }

  def self.allowed_roles_for_user_role(user)
    if user.super_administrator?
      all
    elsif user.administrator?
      all.except_super_adminstrator
    end
  end
end<commit_msg>Translate user role in select input form<commit_after># == Schema Information
#
# Table name: roles
#
#  id         :integer          not null, primary key
#  name       :string(255)
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

#
# == UserRole Model
# - Handle role for a user (admin, ...)
#
class Role < ActiveRecord::Base
  has_many :users

  scope :except_super_adminstrator, -> { where.not(name: 'super_administrator') }

  def self.allowed_roles_for_user_role(user)
    if user.super_administrator?
      all.collect { |c| [I18n.t("role.#{c.name}"), c.id] }
    elsif user.administrator?
      all.except_super_adminstrator.collect { |c| [I18n.t("role.#{c.name}"), c.id] }
    end
  end
end
{'fraction_non_alphanumeric': 0.11598513011152416, 'fraction_numerical': 0.007434944237918215, 'mean_word_length': 2.9472140762463344, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '762363', 'n_tokens_mistral': 458, 'n_tokens_neox': 447, 'n_words': 111}