Quick correction, so the versions screen does display properly. Refs #15

This commit is contained in:
echarp 2016-01-10 01:28:48 +01:00
parent b0fe24ca4b
commit b89ca5deb8
4 changed files with 12 additions and 7 deletions

View File

@ -14,11 +14,10 @@
- @versions.each do |version|
:ruby
if version.event == 'create'
object = version.item_type.constantize.find version.item_id
else
object = version.reify
object = version.item_type.constantize.find_by_id version.item_id
end
next unless object.moderated?
object = version.reify if object.nil?
next unless object.try(:moderated?)
changes = ''
if version.event == 'update'
@ -47,3 +46,8 @@
%em.fa.fa-eye
= paginate @versions
.formats
= link_to versions_path do
%em.fa.fa-rss
= t '.feed'

View File

@ -37,10 +37,9 @@ xml.rdf :RDF,
@versions.each do |version|
if version.event == 'create'
object = version.item_type.constantize.find version.item_id
else
object = version.reify
object = version.item_type.constantize.find_by_id version.item_id
end
object = version.reify if object.nil?
next unless object.moderated?
url = polymorphic_url(version.item_type.tableize.singularize,
id: version.item_id)

View File

@ -398,3 +398,4 @@ reason:
create_html: <em class='fa fa-plus-circle'></em>
update_html: <em class='fa fa-exchange'></em>
destroy_html: <em class='fa fa-trash'></em>
feed: RSS feed

View File

@ -398,3 +398,4 @@ l'adresse:"
create_html: <em class='fa fa-plus-circle'></em>
update_html: <em class='fa fa-exchange'></em>
destroy_html: <em class='fa fa-trash'></em>
feed: Flux RSS