Hi all,
I have been struggling with this problem for a while.
I cannot insert into a table (simple action) with auto-increment
mechanism.
I have got:
rvm with ruby 1.8.7
gem -v is: 1.6.2
rails -v is" 3.0.5
ruby-oci8 1.0.6
activerecord-oracle-adapter, not the enhanced one,
the version I used is 1.0.0.9250.
all above versions are required.
I created a table " programs" with primary key id.
I also created a sequence for auto-increment. : programs_seq
I also created a trigger before insert into that table:
programs_trigger
The table name is programs, therefore, the model name is program
class Program < ActiveRecord::Base
set_primary_key "id"
set_sequence_name "programs_seq"
end
when i try to insert into that table via sqlplus is works, but when I
use rails console I could not, it gives me along errors or exceptions
with primary key,
First part of the errors:
NoMethodError: undefined method `primary_key' for
#<ActiveRecord::ConnectionAdapters::OracleAdapter:0xb728b434> ....
It is very long message, sorry about that.
Please help, I searched for a solution but with no luck.
any help will be appreciated.
Hi all,
I have been struggling with this problem for a while.
I cannot insert into a table (simple action) with auto-increment
mechanism.
I have got:
rvm with ruby 1.8.7
gem -v is: 1.6.2
rails -v is" 3.0.5
ruby-oci8 1.0.6
activerecord-oracle-adapter, not the enhanced one,
the version I used is 1.0.0.9250.
Have you tried the enhanced one? I seem to recall that is the actively maintained one.
activerecord-oracle-adapter’s last official version of Rails it worked with was Rails 2 (2.1 if I recall correctly). It was replaced years ago by activerecord-oracle_enhanced-adapter which works with Rails 2.3.* and Rails 3. If you wish to use the older adapter you are going to have to use an earlier version of Rails 2. I would suggest you tell your host to get with the times and install activerecord-oracle_enhanced-adapter. If they refuse then you are stuck with having to use an older version of Rails 2. At that point I would seriously consider switching hosting providers.