Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

deps. better bools.

  • Loading branch information...
commit 9eaa17da6e1559b7f7b555fb91d41054372ffd14 1 parent ee237ce
ara.t.howard authored
4 dao.gemspec
@@ -104,10 +104,12 @@ Gem::Specification::new do |spec|
104 104
105 105 spec.add_dependency(*["rails", " >= 3.1"])
106 106
107   - spec.add_dependency(*["map", " >= 5.8.0"])
  107 + spec.add_dependency(*["map", " >= 6.0.0"])
108 108
109 109 spec.add_dependency(*["fattr", " >= 2.2"])
110 110
  111 + spec.add_dependency(*["coerce", " >= 0.0.3"])
  112 +
111 113 spec.add_dependency(*["tagz", " >= 9.3"])
112 114
113 115 spec.add_dependency(*["multi_json", " >= 1.0.3"])
3  lib/dao.rb
@@ -19,8 +19,9 @@ def version
19 19 def dependencies
20 20 {
21 21 'rails' => [ 'rails' , ' >= 3.1' ] ,
22   - 'map' => [ 'map' , ' >= 5.8.0' ] ,
  22 + 'map' => [ 'map' , ' >= 6.0.0' ] ,
23 23 'fattr' => [ 'fattr' , ' >= 2.2' ] ,
  24 + 'coerce' => [ 'coerce' , ' >= 0.0.3' ] ,
24 25 'tagz' => [ 'tagz' , ' >= 9.3' ] ,
25 26 'multi_json' => [ 'multi_json' , ' >= 1.0.3' ] ,
26 27 'uuidtools' => [ 'uuidtools' , ' >= 2.1.2' ] ,
4 lib/dao/form.rb
@@ -257,7 +257,7 @@ def checkbox(*args, &block)
257 257 values = options.delete(:values) || options.delete(:checked)
258 258
259 259 unless options.has_key?(:checked)
260   - checked = !!attributes.get(keys)
  260 + checked = Coerce.boolean(attributes.get(keys))
261 261 options[:checked] = checked if checked
262 262 end
263 263
@@ -413,7 +413,7 @@ def select(*args, &block)
413 413 end
414 414
415 415 opts = {:value => value}
416   - opts[:selected] = !!selected if selected
  416 + opts[:selected] = Coerce.boolean(selected) if selected
417 417 option_(opts){ content }
418 418 end
419 419 }
1  test/support_test.rb
@@ -32,7 +32,6 @@
32 32 )
33 33
34 34 assert{ Dao.normalize_parameters(params) }
35   - assert{ params[:dao] = :normalized }
36 35
37 36 assert{ params[:foos].is_a?(Hash) }
38 37 assert{ params[:foos][:k] == 'v' }

0 comments on commit 9eaa17d

Please sign in to comment.
Something went wrong with that request. Please try again.