Skip to content

Instantly share code, notes, and snippets.

@arockwell
Created June 26, 2012 21:10
Show Gist options
  • Save arockwell/2999060 to your computer and use it in GitHub Desktop.
Save arockwell/2999060 to your computer and use it in GitHub Desktop.
ActiveRecord::Base.connection.execute("delete from article_info where article_id = 1")
article_infos = ArticleInfo.find_all_by_article_id(1)
article_infos.size.should == 0
article_copy1 = Article.find(1)
puts "article_info1: #{article_copy1.article_info}"
article_copy2 = Article.find(1)
puts "article_info2: #{article_copy2.article_info}"
article_copy1.last_slide = 1
article_copy2.last_slide = 2
article_copy1.save
article_copy2.save
article_infos = ArticleInfo.find_all_by_article_id(1)
article_infos.size.should == 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment