simple_action 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGM4YTI5YzE2NzM4OTIyMWE2NjcyYzUyYTMzMmYzMGFjYzc2MzM3Yg==
4
+ YzFlM2UwNjk5Mjk0YjdhNGUwNGNkMTczOTQyZDEyMzUwMzA5MzFlNg==
5
5
  data.tar.gz: !binary |-
6
- NjI4Njk3ODc2NmE5NGI2Y2M1MDlhZjM4YzJiYWZkNTYzNjk1OWRlOQ==
6
+ OTNhNjkyZWMzMGZmMTU5Y2RiZjc4MTE5N2UyMjk3MjQxYTQ3NzBhZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjlhNGU4NjljZDVlMWIyYzNmYTNkOWJjZTdiYzViNTc3YTVmNTJhNjgwYmNk
10
- ZjdiNzgyMjQzNzRmZjkwYmNjMjhjMjhkMWY1OTYwNWE2MTE5MTI2NTIzNmMz
11
- NGYwYjRhNmEwY2I1MGNkZjJlMTc4MTIzYmFhZTZiZTU5NzUwZDk=
9
+ ODM5ZmNiNjc4NWJjMjFkN2RlZGRkYzIxMTE5NDVhZTRlODUwNDViZGJhYWI3
10
+ MWFlZDdhN2EwMWZjYWNmZGM0ZWQ3NDY4ZjQ1ZTViMDNkZWY5ZjMyYzk1NTEz
11
+ MTM5M2Y4ZWNhOWY5YThmZDY0YjU0M2I3MjQwMmYxNDhkODY5YTI=
12
12
  data.tar.gz: !binary |-
13
- ODM2NGExMWE1ZTEyMjk0NDk1NTg3NGFhZjUwNDM0NGFiNWJiODc2ODU5YTYx
14
- MjAzY2E3MTMzY2NjYWIwYWM4YjMwZjVlYWRkOWRhZTI5ODdkZTc4NjdjZDVh
15
- YTQyYTMzN2FjZTg5ZTdiMzFjYzc4ZWQ0OTQ0MmRjMjI5MTZhNDA=
13
+ M2RmYzk3ODFjZWQ1YzdhMzU4NDIwMjVmMzc4ZmZmYTIzNjQ4MDI1NzJmMGU4
14
+ ZWRhYzY2NDkwMTliNGVmMThkMzRkNWExYzlhYWM0ODExNGMyYzQ3OWM1ODcx
15
+ YmZlMGU3MjNkMzBmYzc4NDIyNTFiODYwMmQ1MTk5ZTgxOWJlODc=
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_action (1.3.4)
5
- simple_params (>= 1.3.4, < 2.0)
4
+ simple_action (1.3.5)
5
+ simple_params (>= 1.3.6, < 2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -48,7 +48,7 @@ GEM
48
48
  rspec-mocks (2.99.3)
49
49
  shoulda-matchers (2.8.0)
50
50
  activesupport (>= 3.0.0)
51
- simple_params (1.3.4)
51
+ simple_params (1.3.6)
52
52
  activemodel (>= 3.0, < 5.0)
53
53
  shoulda-matchers (~> 2.8)
54
54
  virtus (>= 1.0.0)
@@ -12,6 +12,7 @@ module SimpleAction
12
12
  klass_name = klass_name + "Params"
13
13
  @params_class = Class.new(SimpleAction::Params).tap do |klass|
14
14
  extend ActiveModel::Naming
15
+ klass.with_rails_helpers
15
16
  self.const_set(klass_name, klass)
16
17
  klass.class_eval(&block)
17
18
  end
@@ -10,8 +10,11 @@ module SimpleAction
10
10
  end
11
11
 
12
12
  def method_missing(sym, *args, &block)
13
- return params.send(sym, *args, &block) if pass_sym_to_params?(sym)
14
- super(sym, *args, &block)
13
+ if pass_sym_to_params?(sym)
14
+ params.send(sym, *args, &block)
15
+ else
16
+ super(sym, *args, &block)
17
+ end
15
18
  end
16
19
 
17
20
  private
@@ -3,10 +3,10 @@ require "simple_params"
3
3
  module SimpleAction
4
4
  class Params < ::SimpleParams::Params
5
5
  # Use Rails Helpers by default
6
- class << self
7
- def using_rails_helpers?
8
- true
9
- end
10
- end
6
+ # class << self
7
+ # def using_rails_helpers?
8
+ # true
9
+ # end
10
+ # end
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleAction
2
- VERSION = "1.3.5"
2
+ VERSION = "1.3.6"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "simple_params", ">= 1.3.4", "< 2.0"
21
+ spec.add_dependency "simple_params", ">= 1.3.6", "< 2.0"
22
22
  spec.add_development_dependency "bundler", "~> 1.5"
23
23
  spec.add_development_dependency "rake", "~> 10.1"
24
24
  spec.add_development_dependency "rspec", "~> 2.6"
@@ -215,6 +215,46 @@ describe "SimpleAction acceptance spec" do
215
215
  end
216
216
  end
217
217
 
218
+ context "with destroyed phones" do
219
+ let!(:name) { "billy12" }
220
+
221
+ let(:params) do
222
+ {
223
+ name: name,
224
+ date_of_birth: Date.new(1984, 6, 5),
225
+ phones: [
226
+ "0" => {
227
+ phone_number: "8005551210",
228
+ _destroy: "1"
229
+ },
230
+ "1" => {
231
+ phone_number: "8005551212"
232
+ }
233
+ ]
234
+ }
235
+ end
236
+
237
+ describe "outcome" do
238
+ subject { SimpleActionAcceptance.run(params) }
239
+
240
+ it { should be_valid }
241
+ it { should be_success }
242
+ end
243
+
244
+ describe "result" do
245
+ subject { SimpleActionAcceptance.run(params).result }
246
+
247
+ it { should eq("BILLY 06/05/1984") }
248
+ end
249
+
250
+ describe "effects" do
251
+ it "strips numbers from name" do
252
+ SimpleActionAcceptance.run(params)
253
+ name.should eq("billy")
254
+ end
255
+ end
256
+ end
257
+
218
258
  context "with outlier case" do
219
259
  let!(:name) { "outlier12" }
220
260
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_action
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - brycesenz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_params
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.4
19
+ version: 1.3.6
20
20
  - - <
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.3.4
29
+ version: 1.3.6
30
30
  - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.0'