Skip to content

Commit

Permalink
Fixed some code related to literal arrays after code change in RubyLess.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed Jun 10, 2011
1 parent d2714a3 commit 59d3512
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/zena/use/query_builder.rb
Expand Up @@ -349,7 +349,7 @@ def build_finder(count, rel, params = {})
else_clause = RubyLess.translate(self, "find(#{params[:else].inspect})")
end

if else_clause.klass == Array
if else_clause.klass.kind_of?(Array)
else_klass = else_clause.opts[:elem]
if count == :all
# Get first common ancestor
Expand Down
8 changes: 7 additions & 1 deletion test/integration/zafu_compiler/context.yml
Expand Up @@ -17,4 +17,10 @@ set_var:
dom_id_in_each:
src: "<r:pages in='site limit 2'><li do='each'><r:dom_id/> <p id='this#{dom_id}'/></li></r:pages>"
tem: "/<li><%= var2.zip %> <p id='<%= \"this#\{var2.zip\}\" %>'></p></li>/"
res: "<li>29 <p id='this29'></p></li><li>33 <p id='this33'></p></li>"
res: "<li>29 <p id='this29'></p></li><li>33 <p id='this33'></p></li>"

list_else:
context:
node: status
src: "<ul do='posts'><li do='each' do='link'/><li do='else'>hop</li></ul>"
res: "<ul><li>hop</li></ul>"
6 changes: 5 additions & 1 deletion test/integration/zafu_compiler/display.yml
Expand Up @@ -380,4 +380,8 @@ comment:

insert_slash_slash_exclam:
src: "this that <r:show text='//!'/> blah blah"
res: "this that //! blah blah"
res: "this that //! blah blah"

array_literal:
src: "<p do='%w{one two}'><span do='each' join=', ' do='this'/></p>"
res: "<p><span>one</span>, <span>two</span></p>"

0 comments on commit 59d3512

Please sign in to comment.