When using Rails on top of an Oracle database, you use the oracle enhanced activerecord adapter. This adapter (or Rails) has one weird side-effect: there is no way to avoid using a sequence when inserting a new record.
But, in this comment
, Raimonds Simanovskis hints at the solution.
In an initializer you write:
# a small patch as proposed by the author of OracleEnhancedAdapter: http://blog.rayapps.com/2008/05/13/activerecord-oracle-enhanced-adapter/#comment-240
# if a ActiveRecord model has a sequence with name "autogenerated", the id will not be filled in from any sequence
alias_method :orig_next_sequence_value, :next_sequence_value
if sequence_name == 'autogenerated'
# we assume id must have gotten a good value before insert!
... and in your model you add: