challah 1.2.8 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8db2fa0b8656df8b9ec1ce4af61eab69eb48a841
4
- data.tar.gz: e900fb1380b019de0f3ea52254f090b333895c90
3
+ metadata.gz: 55b927f07b2b2a7d010ec6c193367b44558d9a14
4
+ data.tar.gz: 968f3c0825495e1d5fb765fa61e1b475eaeb8bf6
5
5
  SHA512:
6
- metadata.gz: 33bbed5b8577f97984de4c2aac31e0e73fb7656ae996a836c64d1bf46ea309ff3051f3d92008058d92c5bfe05106320c90293fae690711645bd5df85c82d46d6
7
- data.tar.gz: c8052d8aa09ef9d1f349d3633a421b8c0c5bbf870170c4f64dd9c984b63ac98b3a8c7db1278de0780f24f5feef7bddfe33f0487f8771ab25442aea6073c669cb
6
+ metadata.gz: 00cb5a947fd5e91283c96130479e07b0d6036966907e82139350fe789e22f816e3cdc62e2e87e86585511a14db9a36a924ae9d11bfd6be6d68ee43ba02f5f26c
7
+ data.tar.gz: b7ee6e3c9d23b1afef33fa65f356d7645146b4bcb8f5ada466078ea32a2fca2c208b69263c6e5e153a02e2d8ed72e771c530c224f843880fa3f16cb55d9bb165
@@ -1,42 +1,44 @@
1
- class SessionsController < ApplicationController
2
- before_filter :destroy_session, except: :create
1
+ if defined?(ApplicationController)
2
+ class SessionsController < ApplicationController
3
+ before_filter :destroy_session, except: :create
3
4
 
4
- unloadable
5
+ unloadable
5
6
 
6
- # GET /login
7
- # GET /sign-in
8
- def new
9
- @session = Challah::Session.new(request)
10
- end
11
-
12
- # POST /login
13
- # POST /sign-in
14
- def create
15
- @session = Challah::Session.new(request, params[:session])
16
- @session.ip = request.remote_ip
7
+ # GET /login
8
+ # GET /sign-in
9
+ def new
10
+ @session = Challah::Session.new(request)
11
+ end
17
12
 
18
- if @session.save
19
- redirect_to return_to_path
20
- else
21
- redirect_to signin_path, alert: I18n.translate('sessions.create.failed_login')
13
+ # POST /login
14
+ # POST /sign-in
15
+ def create
16
+ @session = Challah::Session.new(request, params[:session])
17
+ @session.ip = request.remote_ip
18
+
19
+ if @session.save
20
+ redirect_to return_to_path
21
+ else
22
+ redirect_to signin_path, alert: I18n.translate('sessions.create.failed_login')
23
+ end
22
24
  end
23
- end
24
25
 
25
- # GET /logout
26
- # GET /sign-out
27
- def destroy
28
- redirect_to signin_path
29
- end
26
+ # GET /logout
27
+ # GET /sign-out
28
+ def destroy
29
+ redirect_to signin_path
30
+ end
30
31
 
31
- protected
32
+ protected
32
33
 
33
- def destroy_session
34
- current_user_session.destroy
35
- end
34
+ def destroy_session
35
+ current_user_session.destroy
36
+ end
36
37
 
37
- def return_to_path(default_path = '/')
38
- result = session[:return_to]
39
- result = nil if result and result == "http://#{request.domain}/"
40
- result || default_path
38
+ def return_to_path(default_path = '/')
39
+ result = session[:return_to]
40
+ result = nil if result and result == "http://#{request.domain}/"
41
+ result || default_path
42
+ end
41
43
  end
42
- end
44
+ end
@@ -1,3 +1,3 @@
1
1
  module Challah
2
- VERSION = "1.2.8" unless defined?(::Challah::VERSION)
2
+ VERSION = "1.2.9" unless defined?(::Challah::VERSION)
3
3
  end
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.2.8
4
+ version: 1.2.9
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: 2015-04-08 00:00:00.000000000 Z
13
+ date: 2015-09-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline