Cross Reference: diffs_controller.rb
xref
: /
ontohub
/
app
/
controllers
/
diffs_controller.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
class
DiffsController
<
InheritedResources
::
Base
defaults
resource_class
:
Diff
defaults
singleton
:
true
actions
:
show
before_filter
:
check_read_permissions
def
show
@
message
=
repository.commit
_message
(
oid
)
resource.compute
@
changed_files
=
resource.changed
_files
end
protected
def
resource
@
history_entries
||=
Diff.new
(
params
)
end
def
repository
@
repository
||=
Repository.find
_by_path
!
(
params
[:
repository_id
])
end
def
commit_id
@
commit_id
||=
repository.commit
_id
(
params
[:
ref
])
end
def
oid
@
oid
||=
commit_id
[:
oid
]
unless
commit_id.nil
?
end
def
check_read_permissions
authorize
! :
show
,
repository
end
end