Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require 'active_record'
require 'post' # require the post.rb model file from activereocrd/test/models
require 'author' # require the author.rb model file from activereocrd/test/models
puts Post.find(:first).id # Find the first record and print it's id
author = Author.find(1)
author.posts_sorted_by_id_limited.update_all([ "body = ?", "bulk update12" ])
puts Post.find(1).body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment