1
0

Added Quantity nesting with awesome_nested_set

This commit is contained in:
cryptogopher
2019-09-08 20:00:35 +02:00
parent 96509d5285
commit b31ab9d16a
8 changed files with 35 additions and 19 deletions

View File

@@ -5,4 +5,11 @@ module QuantitiesHelper
[translations[k.to_sym], k]
end
end
def parent_options
options = nested_set_options(Quantity, @quantity) do |i|
raw("#{' ' * i.level}#{i.name}")
end
options.unshift([t('.null_parent'), nil])
end
end