challah 1.3.0 → 1.3.1

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: c3d6fd80f0638cb01d51f3160c92792a9d12924c
4
- data.tar.gz: 0641b3c92b52c2f8c3e9b1cf47c11c7fa55b6e7d
3
+ metadata.gz: 23bb94be0e8ab6875dc31cab8fcface51e966048
4
+ data.tar.gz: f57cf4b2de757c7d23fe36b586b6c7ba8db29e65
5
5
  SHA512:
6
- metadata.gz: 98dbd14406c791f07ee32a0f053100949cc90ad4dfa33d59a8c2c3e9094bc984c1348ea2e40d7039dec8ee935e0886ca54eb3b110e46146f1c69fc12a3aab9ce
7
- data.tar.gz: 719ddddb95e07ce9036b22d04f28132e35a2465f23caaa32f695f4cc6f163c4f43d315b96c680716371e0f8f3575cd1b8db2ab8195e77e1b73c375563393a205
6
+ metadata.gz: e79dc0f8f687cb192b2d055f9b448998d72228cc11d95ba8a907e6559a49519305fd5a0f86896a362d77a9eae6b02edee80077b6e2386fb20c52440d7c277f8c
7
+ data.tar.gz: 3f6ec00c9875e628e03b057bd5b5952275b5541c46a4bf8825abdba02bc4e6fbf018bcef0f1da71e4bce61e20adb5284b9a7214a07b0b85770a052aec6f1b524
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
@@ -1,50 +1,51 @@
1
- if defined?(ApplicationController)
2
- class SessionsController < ApplicationController
3
- if respond_to?(:before_action)
4
- # Rails >= 4.0
5
- before_action :destroy_session, except: :create
6
- else
7
- # Rails <= 3.2
8
- before_filter :destroy_session, except: :create
9
- end
1
+ if File.exist?(Rails.root.join("controllers/application_controller"))
2
+ require "application_controller"
3
+ end
10
4
 
11
- unloadable
5
+ class SessionsController < (defined?(ApplicationController) ? ApplicationController : ActionController::Base)
6
+ if respond_to?(:before_action)
7
+ # Rails >= 4.0
8
+ before_action :destroy_session, except: :create
9
+ else
10
+ # Rails <= 3.2
11
+ before_filter :destroy_session, except: :create
12
+ end
12
13
 
13
- # GET /login
14
- # GET /sign-in
15
- def new
16
- @session = Challah::Session.new(request)
17
- end
14
+ # GET /login
15
+ # GET /sign-in
16
+ def new
17
+ @session = Challah::Session.new(request)
18
+ end
18
19
 
19
- # POST /login
20
- # POST /sign-in
21
- def create
22
- @session = Challah::Session.new(request, params[:session])
23
- @session.ip = request.remote_ip
24
-
25
- if @session.save
26
- redirect_to return_to_path
27
- else
28
- redirect_to signin_path, alert: I18n.translate('sessions.create.failed_login')
29
- end
30
- end
20
+ # POST /login
21
+ # POST /sign-in
22
+ def create
23
+ @session = Challah::Session.new(request, params[:session])
24
+ @session.ip = request.remote_ip
31
25
 
32
- # GET /logout
33
- # GET /sign-out
34
- def destroy
35
- redirect_to signin_path
26
+ if @session.save
27
+ redirect_to return_to_path
28
+ else
29
+ redirect_to signin_path, alert: I18n.translate('sessions.create.failed_login')
36
30
  end
31
+ end
37
32
 
38
- protected
33
+ # GET /logout
34
+ # GET /sign-out
35
+ def destroy
36
+ redirect_to signin_path
37
+ end
39
38
 
40
- def destroy_session
41
- current_user_session.destroy
42
- end
39
+ protected
43
40
 
44
- def return_to_path(default_path = '/')
45
- result = session[:return_to]
46
- result = nil if result and result == "http://#{request.domain}/"
47
- result || default_path
48
- end
41
+ def destroy_session
42
+ current_user_session.destroy
43
+ end
44
+
45
+ def return_to_path(default_path = '/')
46
+ result = session[:return_to]
47
+ result = nil if result and result == "http://#{request.domain}/"
48
+ result || default_path
49
49
  end
50
50
  end
51
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: challah
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Tornow
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-03-01 00:00:00.000000000 Z
13
+ date: 2016-04-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.4.5.1
196
+ rubygems_version: 2.2.2
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Rails authentication and sessions