Class Note
In: app/models/note.rb
Parent: ActiveRecord::Base

Methods

Constants

NOTEABLES = ["Grouping", "Student", "Assignment"]

Public Class methods

[Source]

    # File app/models/note.rb, line 18
18:   def self.noteables_exist?
19:     NOTEABLES.each do |classname|
20:       if !(Kernel.const_get(classname).all.empty?)
21:         return true
22:       end
23:     end
24:     return false
25:   end

Public Instance methods

[Source]

    # File app/models/note.rb, line 14
14:   def format_date
15:     return I18n.l(created_at, :format => :long_date)
16:   end

[Source]

    # File app/models/note.rb, line 10
10:   def user_can_modify?(current_user)
11:     return current_user.admin? || user == current_user
12:   end

[Validate]