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: 8bdc73f3d2be4a95ea08736cbeb30e5a63e5df6b
4
- data.tar.gz: c2eefdafd9a6b8dc0975759f261cb5c533370759
3
+ metadata.gz: 19b5c669b24dbd40ab017485b3811663a8de73aa
4
+ data.tar.gz: 4bdc14ffb69aff0ca233c12a28c7b4c7c750aa25
5
5
  SHA512:
6
- metadata.gz: 137940c697d5955704fe135e360eed610cb4767f5ae0b0248487211f7d210b4238dcca04369e47391989a8b08aba70c144536f5ceff86f5af6f50caafe8ec09b
7
- data.tar.gz: 5bc00f7021fd5a5c603739655f3ff12dfeb33cb55bbd7183561eec9133d08d3ba74ece92b2a65db893bbbf80bb36e322d7e6a3d2560768585a680c2cb8c2adfa
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
- javascript_should_refresh_page = ''
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
- render :text => javascript_should_refresh_page, :status => 200
62
+ response[:refresh] = true if refresh_page
63
+
64
+ render :json => response.to_json(), :status => 200
64
65
  return
65
66
  end
66
67
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveRegions
2
- VERSION = '1.4.1'.freeze
2
+ VERSION = '1.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_regions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect