We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
{% if user.account %} {% else %} {% endif %}
class AccountDrop < Liquid::Drop def initialize(account) @account = account end def blank? @account.blank? end end
But it seems that this is not working? Also not with delegate or defs_delegators via forwardable ruby standard module?
The text was updated successfully, but these errors were encountered:
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?
Any ideas on how to make this work?
Sorry, something went wrong.
No branches or pull requests
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?
The text was updated successfully, but these errors were encountered: