weak_parameters 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca7076308dce976d81cd580461945b2a303c95f8
4
- data.tar.gz: 998f9b6adc9057895bb3ae0fd7a41ba738d402e5
3
+ metadata.gz: 8c85836d4a9c0cc561b4f3843fc393d0a48d4ccf
4
+ data.tar.gz: d69dafbf77051a318e6bbac744436c9899050150
5
5
  SHA512:
6
- metadata.gz: 482ee541c93541de8d589cc0d633e05471a5bf5df86a55384819bf3c91a7e015c5301f38e2efa933d2ef1a0c55ef17f32c6458b3ed059960d0b639280a2fd330
7
- data.tar.gz: 2d8e90e7a4d1905a2239720afcac27997b8d1e12aa4ba737b8e009c2857683ef902f3d7edf4364c7b7348e01d9fc625fab757571c3ad7e4f2cb8c5c1c2215c1a
6
+ metadata.gz: 14c03ed3af01ed9297b76ab93db448b72a8ffa53c1dcbc8ff6a8967641b30d9c8bd33882bc6e74cd350c9bc4f194cf87f6b1a26830a34352d8af379d9026a1b1
7
+ data.tar.gz: 02f0e3e72b22e16075066a11a04a5f128e17108407dc748bbb3acc4b3c64ad4bb5377da4094955aeea5edbec3feeb1654e73d10674d64f812edef76707e54186
@@ -3,7 +3,7 @@ module WeakParameters
3
3
  private
4
4
 
5
5
  def valid_type?
6
- %w[0 1 false true].include?(value)
6
+ %w[0 1 false true].include?(value.to_s)
7
7
  end
8
8
 
9
9
  def error_message
@@ -3,8 +3,8 @@ module WeakParameters
3
3
  def validates(action_name, &block)
4
4
  before_filter only: action_name do
5
5
  validator = WeakParameters::Validator.new(params, &block)
6
- WeakParameters.stats[controller_name][action_name] = validator
7
- WeakParameters.stats[controller_name][action_name].validate
6
+ WeakParameters.stats[params[:controller]][params[:action]] = validator
7
+ WeakParameters.stats[params[:controller]][params[:action]].validate
8
8
  end
9
9
  end
10
10
  end
@@ -1,7 +1,7 @@
1
1
  module WeakParameters
2
2
  class IntegerValidator < WeakParameters::BaseValidator
3
3
  def valid_type?
4
- /\A-?\d+\z/ === value
4
+ /\A-?\d+\z/ === value.to_s
5
5
  end
6
6
 
7
7
  def error_message
@@ -1,3 +1,3 @@
1
1
  module WeakParameters
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weak_parameters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-08 00:00:00.000000000 Z
11
+ date: 2013-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.0.0
150
+ rubygems_version: 2.0.2
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Add a validation filter to your controller.
@@ -189,4 +189,3 @@ test_files:
189
189
  - spec/dummy/script/rails
190
190
  - spec/requests/recipes_spec.rb
191
191
  - spec/spec_helper.rb
192
- has_rdoc: