activemodel-globalid 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18f0e49373df39b515e35d8d504ee95c2ec9a99a
|
4
|
+
data.tar.gz: e3fe91038bfbad848fb286f7584a239ebbeb3370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b883aade679f9f1bba26f2a1ba6b1630905a3f399a18133b015c8852f4cc5eb5752ef35391b398b353c82abe21af05d290da35a9c5d32e8d0c7717e0a3b64fa2
|
7
|
+
data.tar.gz: 5cde9bb37bf26cd8c80d6427abfe5e5daa6e19591f4b947255f14310c264a6e2557a0076f67b16204c9feb361d4ba21fef5f16a94042c74eafb1fe24aa5b68d0
|
@@ -6,13 +6,13 @@ module ActiveModel
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
def global_id
|
9
|
-
GlobalID.create(self)
|
9
|
+
@global_id ||= GlobalID.create(self)
|
10
10
|
end
|
11
11
|
alias gid global_id
|
12
12
|
|
13
13
|
def signed_global_id
|
14
|
-
SignedGlobalID.create(self)
|
14
|
+
@signed_global_id ||= SignedGlobalID.create(self)
|
15
15
|
end
|
16
16
|
alias sgid signed_global_id
|
17
17
|
end
|
18
|
-
end
|
18
|
+
end
|
data/lib/active_model/railtie.rb
CHANGED
@@ -1,5 +1,19 @@
|
|
1
|
+
require 'rails/railtie'
|
1
2
|
require 'active_model/global_identification'
|
3
|
+
require 'active_model/global_locator'
|
2
4
|
|
3
|
-
ActiveModel
|
5
|
+
module ActiveModel
|
6
|
+
# = Active Model GlobalID Railtie
|
7
|
+
class Railtie < Rails::Railtie # :nodoc:
|
8
|
+
initializer "active_model.globalid" do
|
9
|
+
config.after_initialize do |app|
|
10
|
+
ActiveModel::SignedGlobalID.verifier = app.message_verifier(:signed_global_ids)
|
11
|
+
end
|
12
|
+
|
13
|
+
ActiveSupport.on_load(:active_record) do
|
14
|
+
send :include, ActiveModel::GlobalIdentification
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
4
19
|
|
5
|
-
ActiveRecord::Base.send :include, ActiveModel::GlobalIdentification
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemodel-globalid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 4.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 4.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activemodel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 4.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 4.1.0
|
41
41
|
description: Serializing models to a single string makes it easy to pass references
|
@@ -61,17 +61,17 @@ require_paths:
|
|
61
61
|
- lib
|
62
62
|
required_ruby_version: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
|
-
- -
|
64
|
+
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: 1.9.3
|
67
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
|
-
- -
|
69
|
+
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.2.2
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Serialize models that can be found by id again (will be part of Active Model).
|