Class LanguageCharacterQuery
In: app/models/language_character_query.rb
Parent: ActiveRecord::Base

Methods

Public Instance methods

[Source]

    # File app/models/language_character_query.rb, line 5
 5:   def to_label
 6:     type     = I18n.t("activerecord.attributes.language_character_query.#{language.iso_639_code}.#{query}.type")
 7:     label    = type
 8:     if sub_type
 9:       sub_type = I18n.t("activerecord.attributes.language_character_query.#{language.iso_639_code}.#{query}.sub_type,#{sub_type}")
10:       label << " [#{sub_type}]"
11:     end
12:     return label
13:   end

Protected Instance methods

[Source]

    # File app/models/language_character_query.rb, line 17
17:   def authorized_for_create?
18:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ADMIN)
19:   end

[Source]

    # File app/models/language_character_query.rb, line 25
25:   def authorized_for_destroy?
26:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ADMIN)
27:   end

[Source]

    # File app/models/language_character_query.rb, line 29
29:   def authorized_for_read?
30:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_USER)
31:   end

[Source]

    # File app/models/language_character_query.rb, line 21
21:   def authorized_for_update?
22:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ADMIN)
23:   end

[Validate]