Created
October 5, 2009 10:12
-
-
Save rsim/202035 to your computer and use it in GitHub Desktop.
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment