Class CharacterAttribute
In: app/models/character_attribute.rb
Parent: ActiveRecord::Base

Methods

Public Class methods

[Source]

    # File app/models/character_attribute.rb, line 10
10:   def self.distinct_jlpt_values
11:     language_character_jlpt = LanguageCharacterAttribute.find_by_language_id_and_attribute(
12:       Language.get_japanese.id, 
13:       LanguageCharacterAttribute::ATTRIBUTE_JLPT)
14:     self.find(
15:       :all,
16:       :select => 'distinct value',
17:       :conditions => ['language_character_attribute_id = ?', language_character_jlpt]
18:     )
19:   end

Public Instance methods

[Source]

   # File app/models/character_attribute.rb, line 5
5:   def to_label
6:     "#{language_character_attribute.to_label} = #{value}"
7:   end

Protected Instance methods

[Source]

    # File app/models/character_attribute.rb, line 24
24:   def authorized_for_create?
25:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ADMIN)
26:   end

[Source]

    # File app/models/character_attribute.rb, line 32
32:   def authorized_for_destroy?
33:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ADMIN)
34:   end

[Source]

    # File app/models/character_attribute.rb, line 36
36:   def authorized_for_read?
37:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_USER)
38:   end

[Source]

    # File app/models/character_attribute.rb, line 28
28:   def authorized_for_update?
29:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ADMIN)
30:   end

[Validate]