Christian Fazzini | 7 Sep 17:25
Picon

Re: Polymorphic advice for this design

Hi Ar,

End-users can either be registered or non-registered users. Any type
of user can suggest a business and a city.

When they suggest a city, they have to put in their first_name,
last_name, email and city name.

When they suggest a business. They have to put in their first_name,
last_name, email, business name and business address.

Initially, I had it working with two separate models: city_suggestion
and business_suggestion. However, since both tables have fields that
can be reused (i.e. first_name, last_name, email), I was thinking of
using a polymorphic association.

I am not sure if this is the right approach or whether I should have
just stuck with my original solution (i.e. two separate tables:
city_suggestion and business_suggestion)

On Sep 7, 11:02 pm, Ar Chron <li...@...> wrote:
> Hmm... seems my interpretation of what you are attempting to do doesn't
> match very well with your unstated goals...  You were asking whether the
> suggestion model should be polymorphic...
>
> Sooo, what exactly is a suggestion in the context of your application
> (what are your users doing)?
> --
> Posted viahttp://www.ruby-forum.com/.

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Gmane