global_uid 3.2.0 → 3.3.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: a4c0d229f2e1c92809e0e1da6efab4e0d001d512
4
- data.tar.gz: 678d63bb8e6ef692db3696da3b2e14c6f9c23ebe
3
+ metadata.gz: 3108ded87e7821a25a8078a56cc0a100a0a04b63
4
+ data.tar.gz: 75dcfb3c8dbd226df06c498bfe1bdc8886deeab4
5
5
  SHA512:
6
- metadata.gz: 41b5c2c2716975be2b808e4ad0322ff04b00b2b0315034443ad4793ca8d95c43dff699a7905d602ae89eb40efeed35bb41dbd1593b8cad599185f159350cd66c
7
- data.tar.gz: 9bc16fb1be55208a00088de408cb127d1974d330393ebfbdaa7cb36d915b6cde478db590f7baee6d0a4259a724606872fb0d7de23890a4ba6a87b27caa3f1670
6
+ metadata.gz: c20258a1f27e97756888d023bb063b17d283aac9514abe7eb2c3e361c1e5b5dcd701ca722671ed270eae4b10443fd6be64bd5e2d4b759f7b5e707751a9c902f7
7
+ data.tar.gz: c3ab5dce7e8efb3e5527d8bb6478936a5620e4336a25b794f7eec80ab2a68badea1b534bed6156f43efa352208619d39eebe754699d450f3d2b51ee24f1cb059
@@ -61,7 +61,11 @@ module GlobalUid
61
61
  def ensure_global_uid_table
62
62
  return @global_uid_table_exists if @global_uid_table_exists
63
63
  GlobalUid::Base.with_connections do |connection|
64
- raise "Global UID table #{global_uid_table} not found!" unless connection.schema_cache.table_exists?(global_uid_table.to_s)
64
+ if ActiveRecord::VERSION::MAJOR >= 5
65
+ raise "Global UID table #{global_uid_table} not found!" unless connection.schema_cache.data_source_exists?(global_uid_table.to_s)
66
+ else
67
+ raise "Global UID table #{global_uid_table} not found!" unless connection.schema_cache.table_exists?(global_uid_table.to_s)
68
+ end
65
69
  end
66
70
  @global_uid_table_exists = true
67
71
  end
@@ -1,13 +1,7 @@
1
1
  module GlobalUid
2
2
  module HasAndBelongsToManyBuilderExtension
3
- def self.included(base)
4
- base.class_eval do
5
- alias_method_chain :through_model, :inherit_global_uid_disabled_from_lhs
6
- end
7
- end
8
-
9
- def through_model_with_inherit_global_uid_disabled_from_lhs
10
- model = through_model_without_inherit_global_uid_disabled_from_lhs
3
+ def through_model
4
+ model = super
11
5
  model.disable_global_uid if model.left_reflection.klass.global_uid_disabled
12
6
  model
13
7
  end
data/lib/global_uid.rb CHANGED
@@ -19,10 +19,10 @@ if defined?(ActiveRecord::SchemaMigration)
19
19
  ActiveRecord::SchemaMigration.disable_global_uid
20
20
  end
21
21
 
22
- if ActiveRecord::VERSION::MAJOR >= 4 && ActiveRecord::VERSION::MINOR >= 1
23
- ActiveRecord::Associations::Builder::HasAndBelongsToMany.send(:include, GlobalUid::HasAndBelongsToManyBuilderExtension)
22
+ if ActiveRecord::VERSION::STRING >= '4.1.0'
23
+ ActiveRecord::Associations::Builder::HasAndBelongsToMany.send(:prepend, GlobalUid::HasAndBelongsToManyBuilderExtension)
24
24
  end
25
25
 
26
- if ActiveRecord::VERSION::MAJOR == 4 && RUBY_VERSION >= '2'
26
+ if ActiveRecord::VERSION::MAJOR >= 4
27
27
  ActiveRecord::SchemaDumper.send(:prepend, GlobalUid::SchemaDumperExtension)
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: global_uid
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Osheroff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-29 00:00:00.000000000 Z
11
+ date: 2015-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -179,9 +179,9 @@ require_paths:
179
179
  - lib
180
180
  required_ruby_version: !ruby/object:Gem::Requirement
181
181
  requirements:
182
- - - ">="
182
+ - - "~>"
183
183
  - !ruby/object:Gem::Version
184
- version: '0'
184
+ version: '2.0'
185
185
  required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  requirements:
187
187
  - - ">="
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  requirements: []
191
191
  rubyforge_project:
192
- rubygems_version: 2.4.7
192
+ rubygems_version: 2.5.0
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: GUID