Skip to content

Instantly share code, notes, and snippets.

@inem
Created April 12, 2009 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inem/93992 to your computer and use it in GitHub Desktop.
Save inem/93992 to your computer and use it in GitHub Desktop.
class Operation < ActiveRecord::Base
def best
created_at
end
def test(b)
"*#{b}*"
end
end
Operation.last.to_json(:methods => [{:test => "aa"}, :best], :only => :id)
=> "{"message": {"test": "*aa*", "id": 19, "best": "2009-04-12T05:44:53Z"}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment