Skip to content

Commit

Permalink
Handle Liquid renaming before_method to liquid_method_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
cantino committed Apr 24, 2017
1 parent bade09a commit d91c430
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/concerns/liquid_droppable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def to_s
@object[0]
end

def before_method(method)
def liquid_method_missing(method)
@object[method]
rescue IndexError
nil
Expand Down
2 changes: 1 addition & 1 deletion app/models/agents/website_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def url

# Wraps Faraday::Utils::Headers
class HeaderDrop < LiquidDroppable::Drop
def before_method(name)
def liquid_method_missing(name)
@object[name.tr('_', '-')]
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def initialize(object)
super
end

def before_method(key)
def liquid_method_missing(key)
@payload[key]
end

Expand Down
2 changes: 1 addition & 1 deletion lib/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def floatify(value)
class LocationDrop
KEYS = Location.members.map(&:to_s).concat(%w[latitude longitude latlng])

def before_method(key)
def liquid_method_missing(key)
if KEYS.include?(key)
@object.__send__(key)
end
Expand Down

0 comments on commit d91c430

Please sign in to comment.