effective_regions 1.4.8 → 1.4.9

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: 1432af453a66d2d1f2672f47789d64692c48c579
4
- data.tar.gz: be31e35b026add332ee28309dae121efbc919bc0
3
+ metadata.gz: 48fb70e0d7cdb9c1ce13f42544f4160da90fd5a7
4
+ data.tar.gz: ed1a7b9e6b1a057e7351d7d2ed9dfe72e1b1f7bf
5
5
  SHA512:
6
- metadata.gz: 52189ffaae99cde2b1e9d56bead2bec8f9117f92782405255535a97dc2290adf4ed62bc664f28fd4fb763e897a3332f23b5f8ae74ecae2025ef3ef07f6c5e95a
7
- data.tar.gz: 0b02fc28bdaa6f45f9982470466427e6d13dbda1bc5ef8642a8d0744d34b342cd30ed72e5b031b52e1b54144b78d7b865d8afdb3f78465c86799d373eb920325
6
+ metadata.gz: 2c55441fefc5c7bdd8b7742b852072cb2b52bd9a934171e9de6352879f17705509314bca4ef361adaa3802c86fc08ab32a6794b24b5eb6b9d668a96941694021
7
+ data.tar.gz: 3981f28747a9bb1cedeeba81a19a524b06dc1580efd853d694a92cc58fbbbbc1d69322d66e0ff33efd868285a38d64790ea77f7fa3d0f00da54b93f5beee91a7
@@ -0,0 +1,9 @@
1
+ module EffectiveRegionsControllerHelper
2
+ def effectively_editing?
3
+ @effectively_editing ||= (
4
+ request.fullpath.include?('edit=true') &&
5
+ (EffectiveRegions.authorized?(controller, :edit, Effective::Region.new()) rescue false)
6
+ )
7
+ end
8
+ alias_method :effectively_editting?, :effectively_editing?
9
+ end
@@ -37,14 +37,6 @@ module EffectiveRegionsHelper
37
37
  end
38
38
  end
39
39
 
40
- def effectively_editing?
41
- @effectively_editing ||= (
42
- request.fullpath.include?('edit=true') &&
43
- (EffectiveRegions.authorized?(controller, :edit, Effective::Region.new()) rescue false)
44
- )
45
- end
46
- alias_method :effectively_editting?, :effectively_editing?
47
-
48
40
  private
49
41
 
50
42
  def ckeditor_region(args, options = {}, &block)
@@ -8,6 +8,7 @@ module EffectiveRegions
8
8
  initializer 'effective_regions.action_controller' do |app|
9
9
  ActiveSupport.on_load :action_controller do
10
10
  helper EffectiveRegionsHelper
11
+ ActionController::Base.send :include, ::EffectiveRegionsControllerHelper
11
12
  end
12
13
  end
13
14
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveRegions
2
- VERSION = '1.4.8'.freeze
2
+ VERSION = '1.4.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_regions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.8
4
+ version: 1.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-24 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -80,6 +80,7 @@ files:
80
80
  - app/assets/images/effective/templates/image_and_title.png
81
81
  - app/assets/javascripts/effective/snippets/current_user_info.js.coffee
82
82
  - app/controllers/effective/regions_controller.rb
83
+ - app/helpers/effective_regions_controller_helper.rb
83
84
  - app/helpers/effective_regions_helper.rb
84
85
  - app/models/concerns/acts_as_regionable.rb
85
86
  - app/models/effective/access_denied.rb