postgresql - Can't access record id field -


I have imported an Excel spreadsheet containing one-to-one relationship entries. For example, The legal name is, but in many places named DBA for each place. There is a record for each DBA place I am filtering through input data which is making a single entry for each legal business name in a table and making a business location entry for each DBA place. I am trying to manually assign a record ID for a legal business in the records of each of our DBA business location.

Here's my problem when I try the following:

  @ dba_business.legal_business_id = @ legal_business.id   

The following error is found. <# 1; Legal Business :: ActiveRecord_Relation: 0x007fe1f2cc3770 & gt;

I tried on the following, but blank @ field dba_business.legal_business_id instead of recording the record ID value. DBA_business.legal_business_id = @legal_business

Legal_Business has_many: dba_business and DBA_business: is_to have been established with legal_business.

I debug to see the attributes, logger.debug "Legal business: # {@ legal_business.inspect}" ). Inspect command is used, and you can clearly define identifying fields as attributes

  legal business: * # and active ActiveCare :: relationships [# & lt; Legal business ID: 58722, user_id: zero, legal_name: ......... *   

I use PostgreSQL 9.3 with RTVM, Rail 4.1, using Ruby 2.1.1 I am here. Any suggestions appreciated.

I recommend reading this:

And then your debug message:

  Legal business: * # more active; ActiveRecord :: relationship [# & lt; Legal business ID: 58722, user_id: zero, legal_name: ......... *   

Hint: where bracket [] is commonly used goes?

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -