get the comments as json
This commit is contained in:
parent
0debfef42f
commit
700d42fe54
|
@ -12,4 +12,14 @@ class Comment
|
|||
validates_presence_of :author, :email, :body
|
||||
validates_length_of :email, :min => 3, :max => 100
|
||||
validates_format_of :email, :with => :email_address
|
||||
|
||||
# overwrite the default to_json, because we don't need all fields
|
||||
def to_json ressource_options
|
||||
{
|
||||
:id => id,
|
||||
:post_id => post.id,
|
||||
:author => author,
|
||||
:body => body
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,4 +15,8 @@ class Post
|
|||
def self.get_released id
|
||||
first(:id => id, :released => true)
|
||||
end
|
||||
|
||||
def acknowledged_comments
|
||||
comments(:acknowledged => true)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue