For a start, you may want to consider using an Observer. Perhaps you
have a class called FlagObserver which provides the necessary methods
to create, read, etc flags for any other model object. The
FlagObserver class definition will in turn state what other models it
will observe (duh) and on which event(s). :)
-5mile
Eddie wrote:> hi.
>
> i want all my models to have a flag model associated to it.
>
> for instance, this very page here, say i write some inappropriate.
> there''s a link to flag this page.
>
> the link would lead to a page that grabs the session of the controller,
> action, and id, and throw it into a flag model with the columns:
>
> flag_type, comment, user_id, controller, action, id, and timestamp
>
> is this database design optimized? or does anyone recommend a better
> way?
> would using polymorphics be used in this case?
>
>
>
>
>
>
> --
> Posted via http://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---