Browse files

deps. better bools.

  • Loading branch information...
1 parent ee237ce commit 9eaa17da6e1559b7f7b555fb91d41054372ffd14 @ahoward committed May 23, 2012
Showing with 7 additions and 5 deletions.
  1. +3 −1 dao.gemspec
  2. +2 −1 lib/dao.rb
  3. +2 −2 lib/dao/form.rb
  4. +0 −1 test/support_test.rb
View
4 dao.gemspec
@@ -104,10 +104,12 @@ Gem::Specification::new do |spec|
spec.add_dependency(*["rails", " >= 3.1"])
- spec.add_dependency(*["map", " >= 5.8.0"])
+ spec.add_dependency(*["map", " >= 6.0.0"])
spec.add_dependency(*["fattr", " >= 2.2"])
+ spec.add_dependency(*["coerce", " >= 0.0.3"])
+
spec.add_dependency(*["tagz", " >= 9.3"])
spec.add_dependency(*["multi_json", " >= 1.0.3"])
View
3 lib/dao.rb
@@ -19,8 +19,9 @@ def version
def dependencies
{
'rails' => [ 'rails' , ' >= 3.1' ] ,
- 'map' => [ 'map' , ' >= 5.8.0' ] ,
+ 'map' => [ 'map' , ' >= 6.0.0' ] ,
'fattr' => [ 'fattr' , ' >= 2.2' ] ,
+ 'coerce' => [ 'coerce' , ' >= 0.0.3' ] ,
'tagz' => [ 'tagz' , ' >= 9.3' ] ,
'multi_json' => [ 'multi_json' , ' >= 1.0.3' ] ,
'uuidtools' => [ 'uuidtools' , ' >= 2.1.2' ] ,
View
4 lib/dao/form.rb
@@ -257,7 +257,7 @@ def checkbox(*args, &block)
values = options.delete(:values) || options.delete(:checked)
unless options.has_key?(:checked)
- checked = !!attributes.get(keys)
+ checked = Coerce.boolean(attributes.get(keys))
options[:checked] = checked if checked
end
@@ -413,7 +413,7 @@ def select(*args, &block)
end
opts = {:value => value}
- opts[:selected] = !!selected if selected
+ opts[:selected] = Coerce.boolean(selected) if selected
option_(opts){ content }
end
}
View
1 test/support_test.rb
@@ -32,7 +32,6 @@
)
assert{ Dao.normalize_parameters(params) }
- assert{ params[:dao] = :normalized }
assert{ params[:foos].is_a?(Hash) }
assert{ params[:foos][:k] == 'v' }

0 comments on commit 9eaa17d

Please sign in to comment.