dao-gateway-active_record 1.4.0 → 1.5.0

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: f25cfbe2e48082dfd1eb2320cc3ccf601354e86b
4
- data.tar.gz: 28e6e6694abe405e24a9f993695ae7ebf165f331
3
+ metadata.gz: d1122b46b0c728ffcbdb6e059578d93495590fdb
4
+ data.tar.gz: fa73bb2fc1c3d622d121f6b3a5363d400dbb7e59
5
5
  SHA512:
6
- metadata.gz: 24728ce83fad31f66667f9f61f7d6a8faccc8667bc5dc7d3f57e81e41bf483c656c06d255dff0625c8742f5242532a3bf2e45500fa7eb30b2acbc7c4f90a3d03
7
- data.tar.gz: 4e67228135668feb54f6b9aa12ecc687dfacde2ee28910ddb03704ca168faeb472743a23104afea0fe5ad1b3de3c2d32848e0960df3f226365205e267c3ddd62
6
+ metadata.gz: 905471068d1d578a812c83bb07d35f5573208e0fcd3f1b7a0cd3851ba0113c6e8d4f82f9b0afa5bfbc68566a887028b36acde1943c087034a06891da2ffbab79
7
+ data.tar.gz: 031bd669d3cd130bbad43a0aeb7c5de537160800371e3beb61353d9a6b0d270ebf85135ae84c3f03a54685a4ce27d567e1bc9c7323a6cfa7f5149f3c8cd24a8f
@@ -3,4 +3,5 @@ rvm:
3
3
  - 2.3.0
4
4
  before_install: gem install bundler -v 1.11.2
5
5
  script:
6
- - CODECLIMATE_REPO_TOKEN=acc07cd7bb42f8460587b9955bedc64c9038f36864b5af326ea7bff6dab66baa bundle exec rspec
6
+ - bundle exec rake
7
+ - CODECLIMATE_REPO_TOKEN=acc07cd7bb42f8460587b9955bedc64c9038f36864b5af326ea7bff6dab66baa bundle exec codeclimate-test-reporter
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.required_ruby_version = '>= 2.2.2'
22
22
 
23
- spec.add_dependency 'dao-gateway', '~> 1.4'
23
+ spec.add_dependency 'dao-gateway', '~> 1.5'
24
24
  spec.add_dependency 'activerecord', '>= 4.2'
25
25
  spec.add_dependency 'activesupport', '>= 4.2'
26
26
 
@@ -28,5 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency 'rake', '~> 10.0'
29
29
  spec.add_development_dependency 'rspec', '~> 3.4'
30
30
  spec.add_development_dependency 'rspec-its'
31
- spec.add_development_dependency 'codeclimate-test-reporter'
31
+ spec.add_development_dependency 'simplecov'
32
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.0'
32
33
  end
@@ -48,6 +48,16 @@ module Dao
48
48
  source.transaction(&block)
49
49
  end
50
50
 
51
+ def with_lock(id, *args, &block)
52
+ source.transaction do
53
+ source.lock(*args).find(id)
54
+ block.call
55
+ end
56
+
57
+ rescue ActiveRecord::StatementInvalid => e
58
+ raise Dao::Gateway::StatementInvalid, e.message
59
+ end
60
+
51
61
  protected
52
62
 
53
63
  def export(base, record = nil)
@@ -0,0 +1,6 @@
1
+ module Dao
2
+ module Gateway
3
+ class StatementInvalid < StandardError
4
+ end
5
+ end
6
+ end
@@ -1,7 +1,7 @@
1
1
  module Dao
2
2
  module Gateway
3
3
  module ActiveRecord
4
- VERSION = '1.4.0'
4
+ VERSION = '1.5.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dao-gateway-active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - llxff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-12-09 00:00:00.000000000 Z
12
+ date: 2017-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dao-gateway
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.4'
20
+ version: '1.5'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.4'
27
+ version: '1.5'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activerecord
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +110,7 @@ dependencies:
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  - !ruby/object:Gem::Dependency
113
- name: codeclimate-test-reporter
113
+ name: simplecov
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
@@ -123,6 +123,20 @@ dependencies:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: codeclimate-test-reporter
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: 1.0.0
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: 1.0.0
126
140
  description: ActiveRecord gateway for dao-repository
127
141
  email:
128
142
  - ll.wg.bin@gmail.com
@@ -144,6 +158,7 @@ files:
144
158
  - lib/dao/gateway/active_record/base.rb
145
159
  - lib/dao/gateway/active_record/base_transformer.rb
146
160
  - lib/dao/gateway/active_record/record_processor.rb
161
+ - lib/dao/gateway/active_record/statement_invalid.rb
147
162
  - lib/dao/gateway/active_record/version.rb
148
163
  homepage: https://github.com/dao-rb/dao-gateway-active_record
149
164
  licenses: