I have a question about using active record and postgresql sequences.
My environment is:
Ruby: ruby-1.9.2-p290 [ x86_64 ]
I have a very simple table:
CREATE TABLE accounts
id bigint NOT NULL,
and I have a simple script for connect to DB:
:adapter => “postgresql”,
:username => “test”,
:password => “”,
:database => “project_development”
class Account < ActiveRecord::Base
account = Account.new
account.username = “User1”
Task: I want use postgresql sequence for generation of primary key.
I use ‘set_sequence_name’, but this don’t work.
Question: How to make active use of the active record of the sequence
to generate a primary key?