registrar-rails 0.0.5.alpha → 0.0.6.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/registrar/rails/controller_extensions.rb +13 -8
- data/lib/registrar/rails/version.rb +1 -1
- data/test/dummy/log/test.log +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa7fa9e54f0d296ddddfb684a048abead36e1c43
|
4
|
+
data.tar.gz: a6741039bfa8fb201098a1ce8293c7330f187b48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 342d948ff27c8168b94ee7fded06c3c86b23ce337af8be2b2c96087c4f318d9c0c6e17ea3a1a9d8f702c35f3c6ff5750b0645364e8ee05c163d74d78367abfa6
|
7
|
+
data.tar.gz: a616424cbf7d2c7bcff40882bfe2cc802974e5d08bdbe4c55257fd26049a124f4b7f83584567dd9bc4ff881f8a0dafb1d61065daeda67be7af5390df4288d45d
|
@@ -49,8 +49,19 @@ module Registrar
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def current_profile
|
52
|
-
|
53
|
-
|
52
|
+
if registrar_profile?
|
53
|
+
@current_profile = build_profile(registrar_profile)
|
54
|
+
else
|
55
|
+
@current_profile
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def reload_current_profile
|
60
|
+
if registrar_profile?
|
61
|
+
reloaded_profile = Registrar::Middleware::config.handler.call(registrar_profile)
|
62
|
+
request.env['registrar.profile'] = reloaded_profile
|
63
|
+
try_to_store_registrar_profile
|
64
|
+
end
|
54
65
|
end
|
55
66
|
|
56
67
|
def logout
|
@@ -62,12 +73,6 @@ module Registrar
|
|
62
73
|
end
|
63
74
|
alias_method :logged_in?, :current_profile?
|
64
75
|
|
65
|
-
def try_to_set_current_profile
|
66
|
-
if registrar_profile?
|
67
|
-
@current_user = build_profile(registrar_profile)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
76
|
def registrar_profile?
|
72
77
|
!!registrar_profile
|
73
78
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -88,3 +88,9 @@ CurrentProfileTest: test_no_current_profile_by_default
|
|
88
88
|
Processing by SomeController#index as HTML
|
89
89
|
Rendered text template (0.0ms)
|
90
90
|
Completed 200 OK in 3ms (Views: 2.7ms)
|
91
|
+
------------------------------------------------------
|
92
|
+
CurrentProfileTest: test_no_current_profile_by_default
|
93
|
+
------------------------------------------------------
|
94
|
+
Processing by SomeController#index as HTML
|
95
|
+
Rendered text template (0.0ms)
|
96
|
+
Completed 200 OK in 4ms (Views: 3.5ms)
|