end
# Add the commenter to the subscribers if necessary
- changeset.subscribers << @user unless changeset.subscribers.exists?(@user)
+ changeset.subscribers << @user unless changeset.subscribers.exists?(@user.id)
# Return a copy of the updated changeset
render :text => changeset.to_xml.to_s, :content_type => "text/xml"
# Find the changeset and check it is valid
changeset = Changeset.find(id)
raise OSM::APIChangesetNotYetClosedError.new(changeset) if changeset.is_open?
- raise OSM::APIChangesetAlreadySubscribedError.new(changeset) if changeset.subscribers.exists?(@user)
+ raise OSM::APIChangesetAlreadySubscribedError.new(changeset) if changeset.subscribers.exists?(@user.id)
# Add the subscriber
changeset.subscribers << @user
# Find the changeset and check it is valid
changeset = Changeset.find(id)
raise OSM::APIChangesetNotYetClosedError.new(changeset) if changeset.is_open?
- raise OSM::APIChangesetNotSubscribedError.new(changeset) unless changeset.subscribers.exists?(@user)
+ raise OSM::APIChangesetNotSubscribedError.new(changeset) unless changeset.subscribers.exists?(@user.id)
# Remove the subscriber
changeset.subscribers.delete(@user)
<div class="buttons clearfix subscribe-buttons">
<form action="#" class="hide_unless_logged_in">
- <% if @changeset.subscribers.exists?(@user) %>
+ <% if @user and @changeset.subscribers.exists?(@user.id) %>
<input class="action-button" type="submit" name="unsubscribe" value="<%= t('javascripts.changesets.show.unsubscribe') %>" data-method="POST" data-url="<%= changeset_unsubscribe_url(@changeset) %>" />
<% else %>
<input class="action-button" type="submit" name="subscribe" value="<%= t('javascripts.changesets.show.subscribe') %>" data-method="POST" data-url="<%= changeset_subscribe_url(@changeset) %>" />
end
def test_comments_of_changeset_count
- assert_equal 3, Changeset.find(changesets(:normal_user_closed_change)).comments.count
+ assert_equal 3, Changeset.find(changesets(:normal_user_closed_change).id).comments.count
end
end
end
def test_delete
- node_template = Node.find(current_nodes(:visible_node))
+ node_template = Node.find(current_nodes(:visible_node).id)
assert_not_nil node_template
assert_equal OldNode.where(:node_id => node_template.id).count, 1