backframe 0.0.16 → 0.0.17

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: 7e529a26c3cbb16f7d83f915b683b34f3e5bcda1
4
- data.tar.gz: 7bd6df514bf432abc3dcf49f5e7433bf1912399e
3
+ metadata.gz: a4cf68307b7e4daf0e68e92f0422863254c24505
4
+ data.tar.gz: eaf759579d793fde01b51a47098d601dde692644
5
5
  SHA512:
6
- metadata.gz: fc67fc81127e6656d2609b79aa23a90a9c36ddb220e8c391e0397f6bebde978d91b7d7fa0e67a1242380e2e830d76afbb4d16af184419e469e4272eb6258bb6a
7
- data.tar.gz: 588a8dbd70ab692476712e1d44ddd450b4750b715e2a33250b7981c29e02447d63857557840c662133f14ba952b1dcd9d0ae560f7d9c1fcf66dbdcf4ea120da5
6
+ metadata.gz: c6a168a9ddb869906d7d59fb6cd46311a3dfc7eac766df01c020dc05a01658ce2f1aeacbc103ec7205521e79b2e1db53e943425d0fe9ffddee392a37cf80fd99
7
+ data.tar.gz: 604de21a7be658700f2024b92051b2f945da6c8046b1cb64b5bcfa1a6d8989218718e2bbd04f6208b6ae6c21d36a902dd3d22240138569524ff14b240f43c071
@@ -12,13 +12,15 @@ module Backframe
12
12
 
13
13
  arguments = args[0]
14
14
 
15
+ activation = arguments[:activation] || 'Backframe::Activation'
16
+
15
17
  class_eval <<-EOV
16
18
 
17
19
  layout 'signin'
18
- before_action :load_#{model.underscore}, :except => :show
20
+ before_action :load_user, :except => :show
19
21
 
20
22
  def show
21
- @activation = Backframe::Activation.find_by(:token => params[:token])
23
+ @activation = #{activation}.find_by(:token => params[:token])
22
24
  if @activation.nil?
23
25
  flash[:error] = I18n.t(:activation_invalid)
24
26
  redirect_to account_signin_path
@@ -50,8 +52,8 @@ module Backframe
50
52
 
51
53
  private
52
54
 
53
- def load_#{model.underscore}
54
- @activation = Backframe::Activation.find_by(:id => session[:activation_id])
55
+ def load_user
56
+ @activation = #{activation}.find_by(:id => session[:activation_id])
55
57
  @user = @activation.user
56
58
  if @user.nil?
57
59
  flash[:error] = I18n.t(:activation_invalid)
@@ -12,11 +12,13 @@ module Backframe
12
12
 
13
13
  arguments = args[0]
14
14
 
15
+ reset = arguments[:reset] || 'Backframe::Reset'
16
+
15
17
  class_eval <<-EOV
16
18
 
17
19
  layout 'signin'
18
20
  before_action :redirect_if_signed_in
19
- before_action :load_#{model.underscore}, :except => [:new,:show]
21
+ before_action :load_user, :except => [:new,:show]
20
22
 
21
23
  def new
22
24
  if request.post?
@@ -34,7 +36,7 @@ module Backframe
34
36
  end
35
37
 
36
38
  def show
37
- @reset = Backframe::Reset.find_by(:token => params[:token])
39
+ @reset = #{reset}.find_by(:token => params[:token])
38
40
  if @reset.nil?
39
41
  flash[:error] = I18n.t(:reset_invalid)
40
42
  redirect_to '#{arguments[:prefix]}/signin'
@@ -43,7 +45,7 @@ module Backframe
43
45
  redirect_to '#{arguments[:prefix]}/signin'
44
46
  else
45
47
  @reset.claim
46
- session[:reset_id] = @reset.user.id
48
+ session[:reset_id] = @reset.id
47
49
  flash[:error] = I18n.t(:reset_password)
48
50
  redirect_to '#{arguments[:prefix]}/reset/password'
49
51
  end
@@ -66,8 +68,9 @@ module Backframe
66
68
 
67
69
  private
68
70
 
69
- def load_#{model.underscore}
70
- @user = #{model}.find_by(:id => session[:reset_id])
71
+ def load_user
72
+ @reset = #{reset}.find_by(:id => session[:reset_id])
73
+ @user = @activation.user
71
74
  if @user.nil?
72
75
  flash[:error] = I18n.t(:reset_invalid)
73
76
  redirect_to account_signin_path
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Backframe
4
- VERSION = '0.0.16'
4
+ VERSION = '0.0.17'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backframe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kops