Skip to content

Commit

Permalink
Removed m_title and m_description from snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
fherreazcue authored and fbacall committed Sep 26, 2024
1 parent c1ea18b commit 5d0c754
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
8 changes: 0 additions & 8 deletions app/models/snapshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ def description
end
end

def m_title
metadata['title']
end

def m_description
metadata['description']
end

def contributor
Person.find(metadata['contributor']['uri'].match(/people\/([1-9][0-9]*)/)[1])
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/snapshots/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<p><strong>Created at:</strong> <%= date_as_string(@snapshot.created_at, true) %></p>

<%= panel('Resource') do %>
<%= render :partial => "general/item_title", :locals => {:item=>@resource, :title=>@snapshot.m_title} %>
<%= item_description @snapshot.m_description -%>
<%= render :partial => "general/item_title", :locals => {:item=>@resource, :title=>@snapshot.metadata['title']} %>
<%= item_description @snapshot.metadata['description'] -%>
<% end %>

<%= panel('Contents') do %>
Expand Down
2 changes: 1 addition & 1 deletion test/unit/investigation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class InvestigationTest < ActiveSupport::TestCase
end

assert_equal 1, investigation.snapshots.count
assert_equal investigation.title, snapshot.m_title
assert_equal investigation.title, snapshot.metadata['title']
end

test 'clone with associations' do
Expand Down
4 changes: 2 additions & 2 deletions test/unit/snapshot_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class SnapshotTest < ActiveSupport::TestCase

assert_equal 'New title', @investigation.title
assert_equal 'New description', @investigation.description
assert_equal old_title, snapshot.m_title
assert_equal old_description, snapshot.m_description
assert_equal old_title, snapshot.metadata['title']
assert_equal old_description, snapshot.metadata['description']
end

test 'generates sensible DOI' do
Expand Down

0 comments on commit 5d0c754

Please sign in to comment.