I'm not sure what is the best approach for my problem. I need a model
for notification (or alerts) in my application. Notifications are based
on
services, have multiple fields to define conditions and are associated
with a user. Here's an example for a reddit notification:

user_id: 1
type: post_karma
condition: above
value: 100

And here's a weather notification:

user_id: 2
type: temperature
city: Seattle
condition: above
value: 70

So both entries are notifications but they have different fields. Should
I:

- Create different models for each type of notification?
- Create a base notification model and other models for each type that
extend the base one?
- Only have 1 model (notification) and then some sort of condition
table. A notification has multiple conditions.

Thanks.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@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/e14441484fc581bc20adc93f4681d1f2%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to