I have a model with a delegate method,
class Card < ApplicationRecord
has_one :meta_sm2
delegate :next_repetition,
to: :meta_sm2
end
Because the underlying model (currently is meta_sm2
) might change in the future, so I would like to make the delegate method next_repetition
to a custom name, like priority
for example.
How can I defined a custom name delegate method, so that I can call the next_repetition
like card.priority
?
Card
class calledcard
. – Pet