Ruby on Rails Wednesday, January 16, 2013

On Jan 16, 2013, at 4:23 PM, Walter Lee Davis wrote:

>
> On Jan 16, 2013, at 4:16 PM, Dave Aronson wrote:
>
>> On Wed, Jan 16, 2013 at 4:09 PM, Walter Lee Davis <waltd@wdstudio.com> wrote:
>>
>>> I would like to mark one image as being the "portrait" for this person,
>>
>> I'd suggest adding that a person has_one portrait, class_name: :Image.
>> In the UI you can have them select one of their Images (or none).
>>
>> -Dave
>
> Does that require me to add another belongs_to to the Image? If I add a has_one, won't I have to balance that on the other side?
>
> Walter

Just tried this in my stunt app, and it would require me to add a person_id to the Photo / Image model, which since it's polymorphic, is sort of beside the point.

Walter

>
>>
>> --
>> Dave Aronson, the T. Rex of Codosaurus LLC,
>> secret-cleared freelance software developer
>> taking contracts in or near NoVa or remote.
>> See information at http://www.Codosaur.us/.
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment