Class: Kublog::Comment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Kublog::Comment
- Defined in:
- app/models/kublog/comment.rb
Instance Method Summary collapse
Instance Method Details
#as_json(args = {}) ⇒ Object
19 20 21 22 |
# File 'app/models/kublog/comment.rb', line 19 def as_json(args={}) args ||={} super(args.merge!({:methods => [:path, :author, :ftime, :admin?]})) end |
#author ⇒ Object
14 15 16 17 |
# File 'app/models/kublog/comment.rb', line 14 def return self. if self.user.nil? return self.user.to_s end |
#email ⇒ Object
32 33 34 |
# File 'app/models/kublog/comment.rb', line 32 def email || user.email end |
#ftime ⇒ Object
28 29 30 |
# File 'app/models/kublog/comment.rb', line 28 def ftime I18n.l(self.created_at, :format => :short) end |
#path ⇒ Object
24 25 26 |
# File 'app/models/kublog/comment.rb', line 24 def path Engine.routes.url_helpers.post_comment_path(self.post, self) end |