1

Rails returns me the following error:

PG::Error: ERROR:  relation "srlzd_data" does not exist

It seems that it uses the singularized table name, but I don't know why. If I force the table name in my SrlzdData model with set_table_name 'srlzd_datas' it works, but it's a crappy workaround!

Any idea from where it could comes? (Rails 3.2.13 / Ruby 1.9.3)

class SrlzdData < ActiveRecord::Base
    belongs_to :user
    attr_accessible :interests
end

class User < ActiveRecord::Base

  has_one :setting, :dependent => :destroy
  has_one :srlzd_data, :dependent => :destroy

  attr_accessible :firstname, :lastname, 
                  :setting_attributes, :srlzd_data_attributes

  accepts_nested_attributes_for :setting, :srlzd_data
end

Thanks a lot!

1 Answer 1

2

data is already a plural, your table name should be srlzd_data

I'd suggest renaming it via migrate.

Sign up to request clarification or add additional context in comments.

1 Comment

Argh... faced to the limits of my english knowledges! I try and let you know.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.