contentful_rails 0.2.1 → 0.2.2.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 +4 -4
- data/lib/contentful_rails/engine.rb +10 -2
- data/lib/contentful_rails/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f4e430813651dde714798c6d6a43f2db0d28bc3
|
4
|
+
data.tar.gz: c681e7e88ba6724ca0201b69055823a57a1c75ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf1d7c05c65e404b982d70172d682d63a52badba72945596c0a0a7a665852e13c3491906f8e8dbfe036d54f5b0dd8041f373ef81cfa469cb16bd66905d40a3a6
|
7
|
+
data.tar.gz: a64ad119a5ed38a6dfa9b4223e644e8464ad33be28a84471ebb6747ecde1e8ff38c0440b296ec58c4b3b6e67c533b803ee423faca34460e72d3783e057f26063
|
@@ -31,10 +31,18 @@ module ContentfulRails
|
|
31
31
|
end
|
32
32
|
|
33
33
|
initializer "subscribe_to_webhook_events", after: :add_entry_mappings do
|
34
|
-
ActiveSupport::Notifications.subscribe(/Contentful.*Entry
|
34
|
+
ActiveSupport::Notifications.subscribe(/Contentful.*Entry\.publish/) do |name, start, finish, id, payload|
|
35
35
|
content_type_id = payload[:sys][:contentType][:sys][:id]
|
36
36
|
klass = ContentfulModel.configuration.entry_mapping[content_type_id]
|
37
|
-
klass
|
37
|
+
# klass will be nil if the content model has been created in contentful but the model in rails hasn't been added
|
38
|
+
unless klass.nil?
|
39
|
+
klass.send(:clear_cache_for, payload[:sys][:id])
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
ActiveSupport::Notifications.subscribe(/Contentful.*Entry\.unpublish/) do |name, start, finish, id, payload|
|
45
|
+
ActionController::Base.new.expire_fragment(%r{.*#{payload[:sys][:id]}.*})
|
38
46
|
end
|
39
47
|
end
|
40
48
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.1
|
4
|
+
version: 0.2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Error Creative Studio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: contentful_model
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.7
|
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
|
-
version: 0.1.
|
26
|
+
version: 0.1.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|