On Jun 10, 2010, at 21:08 , Jeremy Evans wrote:

> On Jun 10, 5:44 pm, Dave Howell <[email protected]> wrote:
>> So it's picking up the fields from the associated table no problem, but 
>> isn't creating the accessor method for percentage. Huh?
> 
> That's expected behavior.  percentage isn't an attribute of
> Ingredient, so there isn't an accessor method created (Sequel doesn't
> implement Model#method_missing).  You can either create an accessor
> method yourself or use b.ingredients[1][:percentage] to access the
> percentage.

Ah. I see. That makes sense. 

I was all set to go ahead and 'create an accessor method myself' and then 
realized I'm really not sure what to make it *on.*
Well, on each member of self.ingredients, but the only way I see to do that is 
(I think), to use :after_load to iterate through each one and add a singleton 
method for 'percentage' to each. That seems very clunky. Is there a better way?


-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to