improve the with_scope tag based on the work on the editor

This commit is contained in:
did 2011-09-27 00:25:47 +02:00
parent ce24270948
commit 718b3c67bb
2 changed files with 8 additions and 9 deletions

View File

@ -23,9 +23,9 @@ module Locomotive
def decode(attributes, context) def decode(attributes, context)
attributes.each_pair do |key, value| attributes.each_pair do |key, value|
attributes[key] = (case value attributes[key] = (case value
when /true|false/ then value == 'true' when /^true|false$/i then value == 'true'
when /[0-9]+/ then value.to_i when /^[0-9]+$/ then value.to_i
when /'(\S+)'/ then $1 when /^["|'](.+)["|']$/ then $1.gsub(/^["|']/, '').gsub(/["|']$/, '')
else else
context[value] context[value]
end) end)

View File

@ -52,7 +52,6 @@ describe ContentInstance do
end end
it 'should find previous item when available' do it 'should find previous item when available' do
puts @second.previous
@second.previous.custom_field_1.should == "first" @second.previous.custom_field_1.should == "first"
@second.previous._position_in_list.should == 0 @second.previous._position_in_list.should == 0
end end