alchemy_domains 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.
@@ -5,8 +5,8 @@ module Alchemy
|
|
5
5
|
Page.class_eval do
|
6
6
|
scope :current_domain, lambda{ |domain_id| includes(:language => :localizations).where('alchemy_localizations.domain_id' => domain_id) }
|
7
7
|
|
8
|
-
def
|
9
|
-
"alchemy/#{request.host}/#{
|
8
|
+
def cache_key(request = nil)
|
9
|
+
"alchemy/#{request.try(:host)}/#{language_code}/#{urlname}".gsub(/\/\//, '/')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# Extending Alchemy::Page
|
3
|
+
|
4
|
+
module Alchemy
|
5
|
+
PagesSweeper.class_eval do
|
6
|
+
|
7
|
+
def expire_page(page)
|
8
|
+
return if page.do_not_sweep
|
9
|
+
page.language.domains.each do |domain|
|
10
|
+
expire_action(page.cache_key(OpenStruct.new(:host => domain.hostname)))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_domains
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: alchemy_cms
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- app/models/alchemy_domains/localization.rb
|
63
63
|
- app/models/language_extension.rb
|
64
64
|
- app/models/page_extension.rb
|
65
|
+
- app/sweepers/alchemy/pages_sweeper_extension.rb
|
65
66
|
- app/views/alchemy_domains/admin/domains/_domain.html.erb
|
66
67
|
- app/views/alchemy_domains/admin/domains/_form.html.erb
|
67
68
|
- app/views/alchemy_domains/admin/domains/edit.html.erb
|
@@ -94,7 +95,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
95
|
version: '0'
|
95
96
|
segments:
|
96
97
|
- 0
|
97
|
-
hash:
|
98
|
+
hash: 3334868432166897656
|
98
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
100
|
none: false
|
100
101
|
requirements:
|
@@ -103,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
104
|
version: '0'
|
104
105
|
segments:
|
105
106
|
- 0
|
106
|
-
hash:
|
107
|
+
hash: 3334868432166897656
|
107
108
|
requirements: []
|
108
109
|
rubyforge_project:
|
109
110
|
rubygems_version: 1.8.24
|