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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b580a085b98b37f32df04936a5135c9f5335a34
4
- data.tar.gz: 013008c9b3252dbf2f92d0d5e57a050d8877d954
3
+ metadata.gz: fa7fa9e54f0d296ddddfb684a048abead36e1c43
4
+ data.tar.gz: a6741039bfa8fb201098a1ce8293c7330f187b48
5
5
  SHA512:
6
- metadata.gz: 183d3f0ec77289e9fb466516de05706dad7bc1ed99e43bed61e72d6f5c7d003152bb33036e4341b8a903c0171842c181f2b27f8f05e804277241e2b92124afbe
7
- data.tar.gz: 347ab56e8417280c55bf35e5c332876744b3350b429f263e0e1f2e22af1bef3165cc23a888fbad57b2c79c1669cd69f384e513fc210a1c278193cc61dea02e44
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
- return @current_profile if @current_profile
53
- try_to_set_current_profile
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
@@ -1,5 +1,5 @@
1
1
  module Registrar
2
2
  module Rails
3
- VERSION = "0.0.5.alpha"
3
+ VERSION = "0.0.6.alpha"
4
4
  end
5
5
  end
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: registrar-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.alpha
4
+ version: 0.0.6.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Owiesniak