Skip to content

Commit

Permalink
Fixed serialization of arrays in zafu_eval.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed Aug 9, 2012
1 parent 439ec3f commit cc613a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,8 @@ def zafu_eval(str, opts = {})
value
elsif value.kind_of?(Time)
format_date(value, opts)
elsif value.kind_of?(Array)
value.join(',')
else
value.to_s
end
Expand Down
9 changes: 8 additions & 1 deletion test/integration/zafu_compiler/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,11 @@ set_var_different_type:
node_eval:
src: "<r:void do='@node.eval(\"title\")'/>"
tem: "<%= @node.zafu_eval(\"title\") %>"
res: "status title"
res: "status title"

node_eval_array:
context:
node: opening
src: "<r:void do='@node.eval(\"set_tag_ids\")'/>"
tem: "<%= @node.zafu_eval(\"set_tag_ids\") %>"
res: "33,34"

0 comments on commit cc613a8

Please sign in to comment.