From: itsme213 Date: 2005-04-06T07:59:39+09:00 Subject: Re: Nitro + Og 0.15.0, Localization, Parametrized mixins, Morphing, SQLServer "Michael Neumann" wrote in message > > I cannot understand what you mean. Can you please explain this a little > > better? > > "Syntax-sugar" for: > > class Posting > > has_many :approval_responses, Approval > has_many :disapproval_responses, Disapproval > > def responses > self.approval_responses + self.disapproval_responses > end > > def add_response(r) > case r > when Approval > add_approval_response(r) > when Disapproval > add_disapproval_response(r) > else > raise > end > end > > end > > And if you could hide the meta for the :approval_responses > and :disapproval_responses, this would be even better. George, It would be really **awesome** if you could add this to og. The above would be correct if not ordered. In the case where we had Ordered include Orderable, :scope => responses the wrappers would (of course) look slightly different def responses (self.approval_responses + self.disapproval_responses).sort_by {|r1,r2| r1.ogs_ordering_field <=> r2.ogs_ordering_field } end Thanks!