Commit 9286b3b5208a6838b7fba06cf8b2c4eb0d5a82cd

Authored by Leandro Santos
1 parent 4bceb5e5

adding as_json method for articles

Showing 1 changed file with 6 additions and 0 deletions   Show diff stats
app/models/article.rb
... ... @@ -730,6 +730,12 @@ class Article < ActiveRecord::Base
730 730 true
731 731 end
732 732  
  733 + #FIXME make this test
  734 + #Define which parameters will be returned in json object
  735 + def as_json(options = {})
  736 + super(:only => [:id, :name, :body, :created_at], :methods => [:title])
  737 + end
  738 +
733 739 private
734 740  
735 741 def sanitize_tag_list
... ...