lib/redd/models/moderatable.rb in redd-0.8.7 vs lib/redd/models/moderatable.rb in redd-0.8.8
- old
+ new
@@ -14,14 +14,17 @@
def remove(spam: false)
@client.post('/api/remove', id: get_attribute(:name), spam: spam)
end
# Distinguish a link or comment with a sigil to show that it has been created by a moderator.
- # @param how [:yes, :no, :admin, :special] how to distinguish the thing
- # @param sticky [Boolean] (for comments) whether to sticky the comment to the top
- def distinguish(how = :yes, sticky: nil)
+ # @param how [:yes, :no, :admin, :special, :sticky] how to distinguish the thing
+ # @note :sticky is for comments. see {Submission#make_sticky} for posts.
+ def distinguish(how = :yes)
params = { id: get_attribute(:name), how: how }
- params[:sticky] = sticky unless sticky.nil?
+ if how == :sticky
+ params[:how] = :yes
+ params[:sticky] = true
+ end
@client.post('/api/distinguish', params)
end
# Remove the sigil that shows a thing was created by a moderator.
def undistinguish