Bugs item #24789, was opened at 2009-03-23 06:15
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7857&aid=24789&group_id=2014
Category: AR-JDBC
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: activerecord_jdbc_adapter tries to get new id from sequence, when id
specified manualy.
Initial Comment:
We are running rails 2.3.2 on jruby 1.2.0. We need to use non automatic
generated ids in our database. Value for primary key is generated manually
before saving newly created AR object. Creating new record in database invokes
::JdbcSpec::PostgreSQL.insert method. It tries to get value for primary key
from sequence, regardless of the fact that it was already specified. As a
workaround we use monkey patch:
::JdbcSpec::PostgreSQL.module_eval do
def insert_with_id(sql, name = nil, pk = nil, id_value = nil, sequence_name =
nil)
if id_value
execute(sql, name)
return id_value
else
insert_without_id(sql, name, pk, id_value, sequence_name)
end
end
alias_method_chain :insert, :id
end
----------------------------------------------------------------------
Comment By: Nick Sieger (nicksieger)
Date: 2009-03-23 12:34
Message:
Hi, we no longer use this tracker to track bugs here. Can you
please file a copy of this bug at
http://kenai.com/jira/browse/ACTIVERECORD_JDBC ?
Thanks!
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=7857&aid=24789&group_id=2014
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel