mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-05 02:41:33 +00:00
Cache expensive options_text call
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
object @variant
|
||||
attributes :id
|
||||
node( :unit_text ) { |v| v.product.name + (v.options_text.empty? ? "" : ": " + v.options_text) }
|
||||
|
||||
node( :unit_text ) do |v|
|
||||
options_text = v.options_text
|
||||
v.product.name + (options_text.empty? ? "" : ": #{options_text}")
|
||||
end
|
||||
|
||||
node( :unit_value ) { |v| v.unit_value }
|
||||
|
||||
Reference in New Issue
Block a user