Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F906857
application_controller.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Aug 30, 10:56 AM
Size
749 B
Mime Type
text/x-ruby
Expires
Mon, Sep 1, 10:56 AM (15 h, 43 m)
Engine
blob
Format
Raw Data
Handle
253681
Attached To
rARCHIVING archiving
application_controller.rb
View Options
class
ApplicationController
<
ActionController
::
Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery
with
:
:exception
helper_method
:current_user
protected
def
current_user
@current_user
||=
User
.
last
end
def
fetch_logs
days_ago
=
params
.
fetch
(
:days_back
,
7
)
.
to_i
rescue
7
if
@client
@logs
=
Log
.
includes
(
:job
)
.
joins
(
job
:
:client
)
.
where
(
Client
:
{
ClientId
:
@client
.
id
})
else
@logs
=
Log
.
includes
(
:job
)
.
joins
(
job
:
{
client
:
{
host
:
:users
}
})
.
where
(
users
:
{
id
:
current_user
.
id
})
end
@logs
=
@logs
.
where
(
'Time > ?'
,
days_ago
.
days
.
ago
)
.
order
(
Time
:
:desc
,
LogId
:
:desc
)
.
page
(
params
[
:page
]
)
end
end
Event Timeline
Log In to Comment