simple_action 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTk3Nzg3MTBhMmRmMmIwZjJkNWIxZDBjODA5ZjdjZWE1YWU2ZGIwYw==
4
+ ODZjYTY2ODQ4MjRiODdjOWZiNGZkZTI3ODFiZjMzNjc2ODg2MzI5YQ==
5
5
  data.tar.gz: !binary |-
6
- YTJlNzYyMDI1ZGJiM2ExODE0MzRlNmEyMTY0MGIzMWU4YjI1NGViNg==
6
+ MDJhNmE2ZTg4Yzc0MTYwYzI1YWNkYTkxY2RlOGQ5Y2UyYjNmNzY4MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2UxODIxMzk4NTFiMDc3NThjYWFlMTQ5YTUyOGRhZmVmOTI5Mzk2MzdjNzU0
10
- MGE3OThhNzY2NTc4ZmFkNjJkYTZkNjUwNWE3YWJhMGU5MTc1N2Q5MGMwNTA0
11
- YTk5Njg3ZWIwMmY1MDc0OWE2NDZmMjMyY2QwNzliMTJkYzdiMjI=
9
+ OGQ4ZGQ0NGRhMzNmODNiY2Y5ODJjOTc3Yzc0ZWYxZjFmYjUwZDdkODllNmI4
10
+ NzI3MmYwYjgwMmI4ZjE1NmMxZDIwOWVhMzBjYzZiYjlkMGYxY2ExMzM5ZjFm
11
+ MWM1OGJkNzQyMzY2YmE1YWI3YTllZjVhMGFiY2FjNWU2ZjlhODY=
12
12
  data.tar.gz: !binary |-
13
- NWM0ZWQyMTUyOTc4Mjk3MzdkODU2MmNiYWQ2MmQ4Mzg1MTU0NzA5ZDJjOGZh
14
- NDdlN2ZjNGFmNjZkZGQ3NTNlMWJkZjI0M2QzYzhjMDIzOGJhMjQ3NWI0ODMw
15
- OTQ3MWE1MDM2ODFmOWU4NTE5MDI0MGY5NzA2N2Y5YjM3ODNlZTk=
13
+ NDlhNjQyODFkZjIyYmFlYTAwNjE3NGRmMTg1MTMxNzE1OTRlZjUwN2MyMzRm
14
+ OTQ3NGQ5NGY4NDYzNGRkMjM3OGM3YzQ5Y2FjMmQwM2MyMWM4N2IzZGY1MmQz
15
+ NzJmMTJlMGRlNDNjMWViYzhmMGZhMGI3MzdlMDZiZWYyZmMwYTU=
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_action (1.0.2)
5
- simple_params (>= 1.0.1, < 2.0)
4
+ simple_action (1.0.3)
5
+ simple_params (>= 1.0.2, < 2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activemodel (4.2.1)
11
- activesupport (= 4.2.1)
10
+ activemodel (4.2.2)
11
+ activesupport (= 4.2.2)
12
12
  builder (~> 3.1)
13
- activesupport (4.2.1)
13
+ activesupport (4.2.2)
14
14
  i18n (~> 0.7)
15
15
  json (~> 1.7, >= 1.7.7)
16
16
  minitest (~> 5.1)
@@ -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.0.1)
51
+ simple_params (1.0.2)
52
52
  activemodel (>= 3.0, < 5.0)
53
53
  shoulda-matchers (~> 2.8)
54
54
  virtus (>= 1.0.0)
@@ -1,3 +1,4 @@
1
+ require "active_model"
1
2
  require_relative 'concerns/accepts_params'
2
3
  require_relative 'concerns/transactable'
3
4
  require_relative 'concerns/delegates_to_params'
@@ -9,6 +10,10 @@ module SimpleAction
9
10
  include DelegatesToParams
10
11
 
11
12
  class << self
13
+ def model_name
14
+ ActiveModel::Name.new(self)
15
+ end
16
+
12
17
  def run(params = {})
13
18
  instance = self.new(params)
14
19
  result = transaction do
@@ -1,3 +1,3 @@
1
1
  module SimpleAction
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
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.0.1", "< 2.0"
21
+ spec.add_dependency "simple_params", ">= 1.0.2", "< 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"
data/spec/service_spec.rb CHANGED
@@ -3,6 +3,12 @@ require 'fixtures/service_spec_class'
3
3
 
4
4
  describe SimpleAction::Service do
5
5
  describe "class_methods", class_methods: true do
6
+ describe "#model_name", model_name: true do
7
+ it "has correct model name" do
8
+ ServiceSpecClass.model_name.should eq("ServiceSpecClass")
9
+ end
10
+ end
11
+
6
12
  describe "#run", run: true do
7
13
  context "with invalid attributes" do
8
14
  let(:outcome) { ServiceSpecClass.run(age: 12) }
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.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - brycesenz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-06-21 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.0.1
19
+ version: 1.0.2
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.0.1
29
+ version: 1.0.2
30
30
  - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.0'