Scrumpy.Gums
06-08-2009, 09:53 PM
I have two DB tables: Themes and Events with the following relevant columns:
Theme:
integer month
Event:
datetime date_begin
So each theme has many events and they are linked through Event date_begin month and Theme month. My question is how to represent this in the models. I've tried the following and many variations in the Theme model but they don't work.
has_many :events, :through => :events_date_begin.month
I could store the month separately in the Event table but then it's redundant. Are there any better alternatives?
Thanks in advance.
Theme:
integer month
Event:
datetime date_begin
So each theme has many events and they are linked through Event date_begin month and Theme month. My question is how to represent this in the models. I've tried the following and many variations in the Theme model but they don't work.
has_many :events, :through => :events_date_begin.month
I could store the month separately in the Event table but then it's redundant. Are there any better alternatives?
Thanks in advance.