mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 10:52:48 -07:00
Merge pull request #696 from Shopify/no-send
Remove possibility for arbitrary sends
This commit is contained in:
@@ -125,8 +125,6 @@ module Liquid
|
|||||||
[]
|
[]
|
||||||
elsif ary.first.respond_to?(:[]) && !ary.first[property].nil?
|
elsif ary.first.respond_to?(:[]) && !ary.first[property].nil?
|
||||||
ary.sort { |a, b| a[property] <=> b[property] }
|
ary.sort { |a, b| a[property] <=> b[property] }
|
||||||
elsif ary.first.respond_to?(property)
|
|
||||||
ary.sort { |a, b| a.send(property) <=> b.send(property) }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -141,8 +139,6 @@ module Liquid
|
|||||||
[]
|
[]
|
||||||
elsif ary.first.respond_to?(:[]) && !ary.first[property].nil?
|
elsif ary.first.respond_to?(:[]) && !ary.first[property].nil?
|
||||||
ary.sort { |a, b| a[property].casecmp(b[property]) }
|
ary.sort { |a, b| a[property].casecmp(b[property]) }
|
||||||
elsif ary.first.respond_to?(property)
|
|
||||||
ary.sort { |a, b| a.send(property).casecmp(b.send(property)) }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -191,8 +187,6 @@ module Liquid
|
|||||||
[]
|
[]
|
||||||
elsif ary.first.respond_to?(:[])
|
elsif ary.first.respond_to?(:[])
|
||||||
ary.reject{ |a| a[property].nil? }
|
ary.reject{ |a| a[property].nil? }
|
||||||
elsif ary.first.respond_to?(property)
|
|
||||||
ary.reject { |a| a.send(property).nil? }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user