dangerzone 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,13 @@
1
1
  private
2
2
 
3
3
  def current_user
4
+ return @current_user if @current_user
4
5
  @current_user = User.find_by_id(session[:user_id]) || User.find_by_remember_token(cookies[:remember_token])
5
- request.remote_ip == @current_user.try(:sign_in_ip) ? @current_user : @current_user ||= User.new(sign_in_ip: request.remote_ip)
6
+ if request.remote_ip == @current_user.try(:sign_in_ip)
7
+ @current_user
8
+ else
9
+ @current_user = User.new(sign_in_ip: request.remote_ip)
10
+ end
6
11
  end
7
12
 
8
13
  def authorize_user
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: dangerzone
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.1
5
+ version: 0.5.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael Crismali
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-13 00:00:00.000000000 Z
12
+ date: 2013-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bcrypt-ruby