Commit edaa773683bda6334d5ce902b72e107292fea968
Committed by
Rodrigo Souto
1 parent
f9f5164a
Exists in
api_tasks
and in
4 other branches
adding as_json method for articles
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
app/models/article.rb
... | ... | @@ -790,6 +790,12 @@ class Article < ActiveRecord::Base |
790 | 790 | true |
791 | 791 | end |
792 | 792 | |
793 | + #FIXME make this test | |
794 | + #Define which parameters will be returned in json object | |
795 | + def as_json(options = {}) | |
796 | + super(:only => [:id, :name, :body, :created_at], :methods => [:title]) | |
797 | + end | |
798 | + | |
793 | 799 | private |
794 | 800 | |
795 | 801 | def sanitize_tag_list | ... | ... |