global_uid 3.0.0 → 3.0.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: 3680d975cbe2d05025cbc770b25a6418e09d04ee
4
- data.tar.gz: 5002baf9f29f436701bf087d26916e0e74d1e946
3
+ metadata.gz: 4942617dbf7d9d51672b04fdddea1ce5125ffe04
4
+ data.tar.gz: 141fb1c6c2c3c8f3357164f0284c0f8d45db4ad6
5
5
  SHA512:
6
- metadata.gz: 7ddcb75af62154ae5b815653fabe3ee66d8f95810d5ef7fe315738db7e105ddc5145984fa04f8eae848795d1e78a0a5247b1e7f11d8345c84b0ebfb872d295e8
7
- data.tar.gz: 80055cb8046cda7b95fab72e7105d913749bd4bc80d893a0c957607a8dc6be0d72d8ce1e95ceca5c1ac41eb588a01ede9a92f7e8215bef935f5fc7b0a728e452
6
+ metadata.gz: ded33c645aed9b6e20336d3163f25d24c9abf8416dedc3caa075fe5c1ab8b6149d27476852ba62e1e72bcff580e550db38258bdf5f7239e00641d04a6e106435
7
+ data.tar.gz: fbc54be78e690c42d328d3c347cce17fa3339667723245e77610667a30e26205d80286562be6af577921b89b4d5333cb04dfc6ba572b70c15c3505b551d539e9
@@ -1,5 +1,6 @@
1
1
  require "global_uid/base"
2
2
  require "global_uid/active_record_extension"
3
+ require "global_uid/has_and_belongs_to_many_builder_extension"
3
4
  require "global_uid/migration_extension"
4
5
  require "global_uid/schema_dumper_extension"
5
6
 
@@ -13,6 +14,11 @@ end
13
14
 
14
15
  ActiveRecord::Base.send(:include, GlobalUid::ActiveRecordExtension)
15
16
  ActiveRecord::Migration.send(:prepend, GlobalUid::MigrationExtension)
17
+
18
+ if ActiveRecord::VERSION::MAJOR >= 4 && ActiveRecord::VERSION::MINOR >= 1
19
+ ActiveRecord::Associations::Builder::HasAndBelongsToMany.send(:include, GlobalUid::HasAndBelongsToManyBuilderExtension)
20
+ end
21
+
16
22
  if ActiveRecord::VERSION::MAJOR == 4 && RUBY_VERSION >= '2'
17
23
  ActiveRecord::SchemaDumper.send(:prepend, GlobalUid::SchemaDumperExtension)
18
24
  end
@@ -0,0 +1,15 @@
1
+ module GlobalUid
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
11
+ model.disable_global_uid if model.left_reflection.klass.global_uid_disabled
12
+ model
13
+ end
14
+ end
15
+ 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.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Osheroff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-19 00:00:00.000000000 Z
11
+ date: 2015-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -165,6 +165,7 @@ files:
165
165
  - lib/global_uid.rb
166
166
  - lib/global_uid/active_record_extension.rb
167
167
  - lib/global_uid/base.rb
168
+ - lib/global_uid/has_and_belongs_to_many_builder_extension.rb
168
169
  - lib/global_uid/migration_extension.rb
169
170
  - lib/global_uid/schema_dumper_extension.rb
170
171
  - lib/global_uid/server_variables.rb