I'm using rails 4.2 & postgresql and I'm working on existing non rails DB. table schema is given below:
# == Schema Information
#
# Table name: customer
#
# CustomerNo :text default("P'::text || nextval('sqcustomer_no"), not null, primary key
# CustomerOperatorId :string(8)
# CustomerType :integer
# BrokerId :string(250)
# Address :text
# SalutationId :integer
Issue is:
customer = Customer.create! #successfully created
customer.id #nil value
customer.CustomerNo #nil value
I'm using 2 extension postgis, plpgsql
and Coutomer.count
increasing properly.
I tried customer.reload
its give me error.
output of customer
instance variable
#<Customer CustomerNo: "P'::text || nextval('sqcustomer_no", CustomerOperatorId: nil, CustomerType: nil, BrokerId: nil, Address: nil, SalutationId: nil>
any idea why I'm getting this?
Thanks Neelesh