class Note

Constants

NOTEABLES

Public Class Methods

noteables_exist?() click to toggle source
# File app/models/note.rb, line 18
def self.noteables_exist?
  NOTEABLES.each do |classname|
    unless Kernel.const_get(classname).all.empty?
      return true
    end
  end
  return false
end

Public Instance Methods

format_date() click to toggle source
# File app/models/note.rb, line 14
def format_date
  I18n.l(created_at, :format => :long_date)
end
user_can_modify?(current_user) click to toggle source
# File app/models/note.rb, line 10
def user_can_modify?(current_user)
  current_user.admin? || user == current_user
end