Rails - Delegate method to last record in has_many relation

Viewed 419

I have a model with A with a has_many B model association. I would like to do something like this in my A model:

def my_method
 self.bs.last.my_method
end

In other words, I would like to delegate my_method to my last B object in the association. Is that possible to achieve with delegate? Think it would be more elegant. Thank you!

1 Answers
Related