+ end
+ end
+
+ def redact
+ redaction_id = params['redaction']
+ unless redaction_id.nil?
+ # if a redaction ID was specified, then set this relation to
+ # be redacted in that redaction. (TODO: check that the
+ # user doing the redaction owns the redaction object too)
+ redaction = Redaction.find(redaction_id.to_i)
+ @old_relation.redact!(redaction)
+
+ else
+ # if no redaction ID was provided, then this is an unredact
+ # operation.
+ @old_relation.redact!(nil)
+ end
+
+ # just return an empty 200 OK for success
+ render :nothing => true
+ end
+
+ private
+
+ def lookup_old_relation
+ @old_relation = OldRelation.where(:relation_id => params[:id], :version => params[:version]).first
+ if @old_relation.nil?