Class: Kwipper::Comment

Inherits:
Model
  • Object
show all
Defined in:
app/models/comment.rb

Constant Summary

Constants inherited from Model

Model::DB_FILE_NAME, Model::DB_NAME, Model::ID_COLUMN, Model::UnknownAttribute

Instance Attribute Summary

Attributes inherited from Model

#id

Instance Method Summary collapse

Methods inherited from Model

all, attr_array_to_hash, column, count, create, db, destroy, #destroy, exists?, find, generate_id, hash_to_key_vals, #initialize, normalize_value_for_db, #save, sql, #sql, table_name, #update, update, where

Constructor Details

This class inherits a constructor from Kwipper::Model

Instance Method Details

#postObject



16
17
18
# File 'app/models/comment.rb', line 16

def post
  @post ||= Post.find post_id
end

#userObject



8
9
10
# File 'app/models/comment.rb', line 8

def user
  @user ||= User.find user_id
end

#usernameObject



12
13
14
# File 'app/models/comment.rb', line 12

def username
  user.username
end