Is there away get a collections parent model from within the collection itself? Where the collection looks like this: User.first.events.upcoming or Group.first.events.upcoming. If the upcoming method is in a mix-in that is shared by two different models how could you find what the parent model is (Group or User)?
on 2008-10-20 20:31
on 2008-10-20 21:19
Found it: proxy_owner User.first.events.upcoming def upcoming case self.proxy_owner.class when User # do stuff for User when Group # do stuff for groups else end end