activerecord-shard_for 0.4.0 → 0.4.1

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: 7e7b2e6d1521f83ec993bccc75ed606b39792a9b
4
- data.tar.gz: ba474a4e900eabfb0bd551da9514111b9322e6df
3
+ metadata.gz: 4922fc214f9808a86225606f05fec0236ec3bc51
4
+ data.tar.gz: 6cdc0fa7c6bd162b71a163344b306ed16e8165a6
5
5
  SHA512:
6
- metadata.gz: 5d5fbe559b15b32b65313380b4aa3d433ffcd01379f19fb756612d7c0f831cd9046279c37e876e5edddac23ae13c5de3bd0d0608a89bd71ff8594b655173f3c6
7
- data.tar.gz: 3df865e864a0e7c39faebb0907630353dce1f2d0663747893f111574ea74b63f1b2d1deac38b2f449ed6c4a53d31ef9ab9236fded931dae3acd163160b511c9c
6
+ metadata.gz: 20fb33271d1d5b08213e09c34b4ca4d0fc7455cbe92a2a60f0b2b9edc16b4dda4c21939fada4ed9c68f2da07db50370a6faf399304827d15d88006175b859c2e
7
+ data.tar.gz: 749685bb5b2402582a73f9fc3672a2e3efb699d2bcfd839df834a27f65da50a48d74083e2b41e7b5156dfaa6d7175f8eb0be2cd9a01b7a231d0cbf6bbdd76d68
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG for activerecord-shard_for
2
2
 
3
+ ## 0.4.1
4
+
5
+ - Fix defined_enums is empty. [#11](https://github.com/yuemori/activerecord-shard_for/pull/11)
6
+
3
7
  ## 0.4.0
4
8
 
5
9
  - Distkey support to instance method. [#9](https://github.com/yuemori/activerecord-shard_for/pull/9)
@@ -32,8 +32,6 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'pry-inline'
33
33
  spec.add_development_dependency 'pry-rescue'
34
34
  spec.add_development_dependency 'rubocop'
35
- spec.add_development_dependency 'guard-rubocop'
36
- spec.add_development_dependency 'guard-rspec'
37
35
  spec.add_development_dependency 'appraisal'
38
36
  spec.add_development_dependency 'sqlite3'
39
37
  spec.add_development_dependency 'rspec-parameterized'
@@ -13,6 +13,7 @@ require 'activerecord/shard_for/shard_repogitory'
13
13
  require 'activerecord/shard_for/all_shards_in_parallel'
14
14
  require 'activerecord/shard_for/replication_mapping'
15
15
  require 'activerecord/shard_for/railtie' if defined?(Rails)
16
+ require 'activerecord/shard_for/patch'
16
17
 
17
18
  module ActiveRecord
18
19
  module ShardFor
@@ -10,6 +10,8 @@ module ActiveRecord
10
10
  class_attribute :shard_repository, instance_writer: false
11
11
  class_attribute :replication_mapping, instance_writer: false
12
12
  class_attribute :distkey, instance_writer: false
13
+
14
+ include ActiveRecord::ShardFor::Patch
13
15
  end
14
16
 
15
17
  module ClassMethods
@@ -0,0 +1,16 @@
1
+ module ActiveRecord
2
+ module ShardFor
3
+ module Patch
4
+ extend ActiveSupport::Concern
5
+
6
+ module ClassMethods
7
+ # For ActiveRecord::Enum patch.
8
+ # See https://github.com/yuemori/activerecord-shard_for/issues/10
9
+ def enum(definitions)
10
+ super
11
+ shard_repository.all.each { |shard| shard.defined_enums = defined_enums }
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module ShardFor
3
- VERSION = '0.4.0'.freeze
3
+ VERSION = '0.4.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-shard_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yuemori
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-31 00:00:00.000000000 Z
11
+ date: 2016-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -178,34 +178,6 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: guard-rubocop
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: guard-rspec
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
181
  - !ruby/object:Gem::Dependency
210
182
  name: appraisal
211
183
  requirement: !ruby/object:Gem::Requirement
@@ -300,6 +272,7 @@ files:
300
272
  - lib/activerecord/shard_for/errors.rb
301
273
  - lib/activerecord/shard_for/hash_modulo_router.rb
302
274
  - lib/activerecord/shard_for/model.rb
275
+ - lib/activerecord/shard_for/patch.rb
303
276
  - lib/activerecord/shard_for/railtie.rb
304
277
  - lib/activerecord/shard_for/replication_mapping.rb
305
278
  - lib/activerecord/shard_for/shard_repogitory.rb