alego 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/alego.rb +6 -4
  2. data/lib/alego/version.rb +1 -1
  3. metadata +1 -1
@@ -11,8 +11,8 @@ module Alego
11
11
  valida_tela
12
12
  end
13
13
 
14
- def set_usuario_corrente=(usuario)
15
- @usuario_corrente = usuario
14
+ def set_usuario_corrente(usuario)
15
+ @@usuario_corrente = usuario
16
16
  session[:usuario_id] = usuario.id
17
17
  end
18
18
 
@@ -25,7 +25,7 @@ module Alego
25
25
 
26
26
  def valida_login
27
27
  begin
28
- if usuario_corrente
28
+ if @@usuario_corrente
29
29
  return true
30
30
  else
31
31
  flash[:erro]="Falha no login"
@@ -45,7 +45,9 @@ module Alego
45
45
  nome = controller_name
46
46
  usuario = nil
47
47
  if user == nil
48
- usuario ||= Usuario.find(session[:usuario_id])
48
+ if session[:usuario_id] != nil
49
+ usuario ||= Usuario.find(session[:usuario_id])
50
+ end
49
51
  else
50
52
  usuario = user
51
53
  end
@@ -1,3 +1,3 @@
1
1
  module Alego
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alego
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: