Class: LogviewsController
Instance Method Summary
collapse
#copy, #six_local_auto_login
#active_scaffold_render_secure_download, #assign_names_with_active_scaffold, #render_with_active_scaffold, #search_generic_view_paths?
Instance Method Details
#conditions_for_collection ⇒ Object
47
48
49
50
|
# File 'lib/six-updater-web/app/controllers/logviews_controller.rb', line 47
def conditions_for_collection
s = Logsession.find(:last)
['logsession_id = (?)', s] if s
end
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/six-updater-web/app/controllers/logviews_controller.rb', line 12
def upd
s = Log.find(:last, :select => "id,updated_at")
s = Log.new unless s
logger.debug "Latest entry: #{s.id}"
a = false
if session[:logentry] && session[:logupdated]
logger.debug "Session entry #{session[:logentry]} - #{session[:logupdated]}"
if s.id != session[:logentry] || s.updated_at != session[:logupdated]
session[:logentry] = s.id
session[:logupdated] = s.updated_at
logger.debug "New session entry #{session[:logentry]} - #{session[:logupdated]}"
a = true
end
else
session[:logentry] = s.id
session[:logupdated] = s.updated_at
logger.debug "New session entry #{session[:logentry]} - #{session[:logupdated]}"
a = true
end
render :nothing => true unless a
end
|