Created
March 8, 2017 03:21
-
-
Save kilfu0701/157034436d464b98c9525e407b8ca2cb to your computer and use it in GitHub Desktop.
Output JSON format in Rails Console (including query log)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
post = Post.find(3936) | |
ActiveModel::ArraySerializer.new([post], serializer: PostSerializer).to_json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment