On Wed, Mar 29, 2017, at 02:37, tom wrote:
> hi,i am trying to use ror on a legacy system.
> belongs_to :ProvincialTaxAreaCode, class_name: "TaxArea", foreign_key:
> "ProvincialTaxAreaCode" #, primary_key: "ProvincialTaxAreaCode"
> ProvincialTaxAreaCode is a varchar(20)
> <select class="select optional form-control"
> id="record_ProvincialTaxAreaCode"><option value=""></option>
> <option value="1">test- 123</option></select>
> ActiveRecord::AssociationTypeMismatch (TaxArea(#109333370) expected, got
> how can i still use the varchar field without converting it???
I don't think you can use same name for attribute and association
because it'll be confusing (what does model.ProvincialTaxAreaCode mean?
Is it the attribute or the association?). Try naming the association
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To post to this group, send email to email@example.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1490735977.2576592.926619240.739914C5%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.