Class Sentence
In: app/models/sentence.rb
Parent: ActiveRecord::Base

Methods

Included Modules

KotobaModel

Public Class methods

[Source]

   # File app/models/sentence.rb, line 5
5:   def self.overview
6:     KotobaModel.overview(self)
7:   end

Public Instance methods

[Source]

    # File app/models/sentence.rb, line 15
15:   def to_label
16:     "#{sentence}"
17:   end

[Source]

    # File app/models/sentence.rb, line 19
19:   def to_link
20:     link = nil
21:     
22:     if source_description =~ /tatoeba version/
23:       link = "http://tatoeba.fr/contributions/show/#{source_tag}"  
24:     end
25:     
26:     return link
27:   end

Protected Instance methods

[Source]

    # File app/models/sentence.rb, line 31
31:   def authorized_for_create?
32:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ADMIN)
33:   end

[Source]

    # File app/models/sentence.rb, line 39
39:   def authorized_for_destroy?
40:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_ADMIN)
41:   end

[Source]

    # File app/models/sentence.rb, line 43
43:   def authorized_for_read?
44:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_USER)
45:   end

[Source]

    # File app/models/sentence.rb, line 35
35:   def authorized_for_update?
36:     return Authorize.is_role_allowed_for_user?(current_user, UserRole::USER_ROLE_USER)
37:   end

[Validate]