Skip to content

Instantly share code, notes, and snippets.

@inem
Created April 12, 2009 13:03
Show Gist options
  • 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