Open h0jeZvgoxFepBQ2C opened 4 months ago
It seems that you can at least overwrite the invokable methods:
class AccountDrop < Liquid::Drop
delegate :blank?, :present?, to: :@account
def initialize(account)
@account = account
end
def self.invokable_methods
super_methods = super()
custom_methods = Set.new(%w[blank? present?])
super_methods + custom_methods
end
end
So at least following works now:
{% if user.account.present? %}
{% else %}
{% endif %}
but this still not?
{% if user.account %}
{% else %}
{% endif %}
Any ideas on how to make this work?
Hi,
we just figured out that overriding the methods blank? or present? doesn't work to be overriden in drops, f.e. we would like to do following:
But it seems that this is not working? Also not with delegate or defs_delegators via forwardable ruby standard module?