public
Last active

  • Download Gist
add_limit_offset_patch_test.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
require 'active_record'
 
ActiveRecord::Base.establish_connection(
:adapter=>"ibm_db",
:database=>"arunit",
:username=>"user",
:password=>"secret",
:parameterized=>false
)
 
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.