Ruby on Rails Thursday, May 21, 2015

Do these addresses have any difference besides being primary or secondary? Are there extra fields in one that are not in the other? Or is primary maybe a boolean on the address object?

Walter

On May 21, 2015, at 3:36 PM, Elizabeth McGurty <emcgurty2@gmail.com> wrote:

> I have a parent table. And associated with that parent table is two possible addresses, a primary one and/or an alternative: (has_many and accepts_nested_attributes_for).
>
> Rather than creating a second addresses table, I have used a flag, address_type to distinguish primary from alternative, which will apparently only be useful if I can create a condition on fields_for
>
> But now as I explore and research more, seems that I cannot create a condition on fields_for addresses, type => 'alternative' or 'primary'.
>
> I want to utilize Rails associations... Should I just create tables: primary_addresses and alternative_addresses?
>
> Thanks,
>
> Liz
>
> --
> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ae5620b7-a237-4ba2-ac52-1596fa3b7d8a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/35D23682-9E4B-4B3D-A985-FB12B485C269%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment