Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "rubygems"
- require "activerecord"
- # ActiveRecord::Base.establish_connection :adapter=>"oracle_enhanced",:username=>"hr",:password=>"hr",:database=>"orcl"
- ActiveRecord::Base.establish_connection :adapter=>"jdbcsqlite3", :database=>"jruby_test.sqlite3", :timeout => 5000
- ActiveRecord::Schema.define do
- suppress_messages do
- create_table :posts, :force => true do |t|
- t.string :title
- end
- create_table :comments, :force => true do |t|
- t.string :body
- t.integer :post_id
- end
- end
- end
- class Post < ActiveRecord::Base
- has_many :comments
- end
- class Comment < ActiveRecord::Base
- belongs_to :post
- end
- p = Post.create(:title => "test")
- p.comments.create(:body => "test")
- # JRuby 1.4RC1 will return false which is wrong
- puts Post.first.comments == Post.first.comments
Add Comment
Please, Sign In to add comment