typus 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/typus/authentication/session.rb +5 -5
- data/lib/typus/format.rb +2 -4
- data/lib/typus/version.rb +1 -1
- metadata +4 -4
@@ -23,20 +23,20 @@ module Typus
|
|
23
23
|
#++
|
24
24
|
def current_user
|
25
25
|
|
26
|
-
|
26
|
+
@current_user ||= Typus.user_class.find(session[:typus_user_id])
|
27
27
|
|
28
|
-
unless Typus::Configuration.roles.has_key?(
|
28
|
+
unless Typus::Configuration.roles.has_key?(@current_user.role)
|
29
29
|
raise _t("Role does no longer exists.")
|
30
30
|
end
|
31
31
|
|
32
|
-
unless
|
32
|
+
unless @current_user.status
|
33
33
|
back_to = (request.env['REQUEST_URI'] == admin_dashboard_path) ? nil : request.env['REQUEST_URI']
|
34
34
|
raise _t("Typus user has been disabled.")
|
35
35
|
end
|
36
36
|
|
37
|
-
I18n.locale =
|
37
|
+
I18n.locale = @current_user.preferences[:locale]
|
38
38
|
|
39
|
-
return
|
39
|
+
return @current_user
|
40
40
|
|
41
41
|
rescue Exception => error
|
42
42
|
session[:typus_user_id] = nil
|
data/lib/typus/format.rb
CHANGED
@@ -64,11 +64,9 @@ module Typus
|
|
64
64
|
render format => data.send("to_#{format}", :methods => methods, :except => except)
|
65
65
|
end
|
66
66
|
|
67
|
-
def data
|
67
|
+
def data
|
68
68
|
eager_loading = @resource.reflect_on_all_associations(:belongs_to).map { |i| i.name }
|
69
|
-
|
70
|
-
options.merge!(args.extract_options!)
|
71
|
-
@resource.all(options)
|
69
|
+
@resource.joins(@joins).where(@conditions).order(@order).includes(eager_loading)
|
72
70
|
end
|
73
71
|
|
74
72
|
end
|
data/lib/typus/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 2
|
10
|
+
version: 3.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Francesc Esplugas
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-22 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|