effective_regions 1.4.1 → 1.4.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19b5c669b24dbd40ab017485b3811663a8de73aa
|
4
|
+
data.tar.gz: 4bdc14ffb69aff0ca233c12a28c7b4c7c750aa25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0e7e782326af781d20f34dde6ebda482cc07486040706c8cab24fa9880883c22c89e4d77f55c351422e544290c325938a6b19e3a64cc9d1e2f358bc6c9eceac
|
7
|
+
data.tar.gz: 1e23b7d6abad0479bdd28ecdc5ea6e2fe1a4d93175f13d07c76c0d2346abc03f66665e46901ee7fc77bdd759e25a334000213e18eafa5bf68b81a90bd2c11e79
|
@@ -18,7 +18,8 @@ module Effective
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def update
|
21
|
-
|
21
|
+
refresh_page = false
|
22
|
+
response = {}
|
22
23
|
|
23
24
|
Effective::Region.transaction do
|
24
25
|
(request.fullpath.slice!(0..4) rescue nil) if request.fullpath.to_s.starts_with?('/edit') # This is so the before_save_method can reference the real current page
|
@@ -48,19 +49,19 @@ module Effective
|
|
48
49
|
(vals[:snippets] || []).each { |snippet, vals| region.snippets[snippet] = vals }
|
49
50
|
|
50
51
|
# Last chance for a developer to make some changes here
|
51
|
-
if (run_before_save_method(region, regionable) rescue nil) == :refresh
|
52
|
-
javascript_should_refresh_page = 'refresh'
|
53
|
-
end
|
52
|
+
refresh_page = true if (run_before_save_method(region, regionable) rescue nil) == :refresh
|
54
53
|
|
55
54
|
to_save.save!
|
56
55
|
end
|
57
56
|
|
58
57
|
# Hand off the appropriate params to EffectivePages gem
|
59
|
-
if defined?(EffectivePages)
|
58
|
+
if defined?(EffectivePages) && params[:effective_menus].present?
|
60
59
|
Effective::Menu.update_from_effective_regions!(params[:effective_menus])
|
61
60
|
end
|
62
61
|
|
63
|
-
|
62
|
+
response[:refresh] = true if refresh_page
|
63
|
+
|
64
|
+
render :json => response.to_json(), :status => 200
|
64
65
|
return
|
65
66
|
end
|
66
67
|
|