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 +4 -4
- data/lib/global_uid.rb +6 -0
- data/lib/global_uid/has_and_belongs_to_many_builder_extension.rb +15 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4942617dbf7d9d51672b04fdddea1ce5125ffe04
|
4
|
+
data.tar.gz: 141fb1c6c2c3c8f3357164f0284c0f8d45db4ad6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ded33c645aed9b6e20336d3163f25d24c9abf8416dedc3caa075fe5c1ab8b6149d27476852ba62e1e72bcff580e550db38258bdf5f7239e00641d04a6e106435
|
7
|
+
data.tar.gz: fbc54be78e690c42d328d3c347cce17fa3339667723245e77610667a30e26205d80286562be6af577921b89b4d5333cb04dfc6ba572b70c15c3505b551d539e9
|
data/lib/global_uid.rb
CHANGED
@@ -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.
|
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:
|
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
|