This commit is contained in:
albert
2013-03-22 10:47:24 -07:00
parent 3e4d149d28
commit 4dcc21a97a
6 changed files with 30 additions and 7 deletions

View File

@@ -132,7 +132,7 @@ class AnonymousUser
def decrement!(field)
end
def role
:anonymous
end

View File

@@ -123,7 +123,8 @@ class Note < ActiveRecord::Base
end
def create_version
CurrentUser.increment!(:note_update_count)
CurrentUser.user.increment!(:note_update_count)
update_column(:version, version.to_i + 1)
versions.create(
:updater_id => updater_id,
@@ -134,7 +135,8 @@ class Note < ActiveRecord::Base
:width => width,
:height => height,
:is_active => is_active,
:body => body
:body => body,
:version => version
)
end

View File

@@ -22,7 +22,7 @@
<tr>
<td></td>
<td><%= link_to note_version.post_id, post_path(note_version.post_id) %></td>
<td><%= link_to "#{note_version.note_id}.#{note_version.id}", note_versions_path(:search => {:note_id => note_version.note_id}) %></td>
<td><%= link_to "#{note_version.note_id}.#{note_version.version}", note_versions_path(:search => {:note_id => note_version.note_id}) %></td>
<td><%= h(note_version.body) %> <% unless note_version.is_active? %>(deleted)<% end %></td>
<% if CurrentUser.is_janitor? %>
<td>