app/models/flexite/arr_entry.rb in flexite-0.0.18 vs app/models/flexite/arr_entry.rb in flexite-0.0.19
- old
+ new
@@ -24,13 +24,21 @@
def t_node
node = super.except('value')
if entries.any?
- node.merge!('entries' => entries.map(&:t_node))
+ node.merge!('entries' => entries.order_by_value.map(&:t_node))
end
node
+ end
+
+ def dig(level)
+ if level.to_sym == :entries
+ return send(level).order_by_value
+ end
+
+ super
end
private
def form_entries