wagon_rails 0.4.3 → 0.4.4

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: d368adc5fff19030bf0eb410e812c6159244f4b4
4
- data.tar.gz: a3d5ea837b37770c5bbfb9a16a87d4e58bb12289
3
+ metadata.gz: 0ba116e82293e08bdb66abf7e45f84b94d1dbab6
4
+ data.tar.gz: b079515bf7dde618d2b187243ff2cdf1f90b5b68
5
5
  SHA512:
6
- metadata.gz: 743e31676672ff7fc1f10150109b7ca3208fe6e18db186560fe838e4a39dc36a5bd50d5c8ddf70f9ad80a64a112a7938fb25aab7986449a8c4daf7d4f91e32fa
7
- data.tar.gz: 6f321a99d8d50dafa146a8289a30fba602f9240d790b4d2dc6e56b9702b1301f75c3bd9c7a2189787f116a5bf243dae85465b5e535487b2a357b5f425281dead
6
+ metadata.gz: eeac743f94dad21d250252bbada19636192f984d6a04dd839cb9f5a59c25e4d3933dd23eaafbde3c2122fc89304b853365bd05bf0226c90958a1c8939bf3dc7c
7
+ data.tar.gz: a53b1d688fdddc6d907fa7eadbfb36bfedc003038f146bc3a9a46c1b78ccc0eceb3fa95575ea47284ac2bd64363fb8e7f2ffab956802d03dd50582b11837af4d
@@ -1,5 +1,5 @@
1
1
  module WagonRails
2
2
  RAILS_VERSION = "4.2.0"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
- VERSION = "0.4.3"
4
+ VERSION = "0.4.4"
5
5
  end
@@ -11,7 +11,7 @@ gem "high_voltage"
11
11
  gem "devise"
12
12
  gem "pundit"
13
13
  gem "paperclip"
14
- gem "aws-sdk"
14
+ gem "aws-sdk", "< 2.0"
15
15
 
16
16
  gem "jquery-rails"
17
17
  gem "sass-rails", "~> 5.0"
@@ -1,20 +1,17 @@
1
1
  class ApplicationController < ActionController::Base
2
+ include Pundit
3
+
2
4
  protect_from_forgery with: :exception
3
- before_filter :authenticate_user!, unless: :pages_controller?
4
5
 
5
- include Pundit
6
- after_action :verify_authorized, except: :index, unless: :devise_or_pages_controller?
6
+ before_action :authenticate_user!, unless: :pages_controller?
7
+
8
+ after_action :verify_authorized, except: :index, unless: :devise_or_pages_controller?
7
9
  after_action :verify_policy_scoped, only: :index, unless: :devise_or_pages_controller?
8
10
 
9
11
  rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
10
12
 
11
13
  private
12
14
 
13
- def user_not_authorized
14
- flash[:error] = I18n.t('controllers.application.user_not_authorized', default: "You can't access this page.")
15
- redirect_to(root_path)
16
- end
17
-
18
15
  def devise_or_pages_controller?
19
16
  devise_controller? || pages_controller?
20
17
  end
@@ -22,4 +19,9 @@ class ApplicationController < ActionController::Base
22
19
  def pages_controller?
23
20
  controller_name == "pages" # Brought by the `high_voltage` gem
24
21
  end
22
+
23
+ def user_not_authorized
24
+ flash[:error] = I18n.t('controllers.application.user_not_authorized', default: "You can't access this page.")
25
+ redirect_to(root_path)
26
+ end
25
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wagon_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ssaunier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-23 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler