remove uniqueness constraint on postupdates
This commit is contained in:
@@ -1383,7 +1383,7 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def notify_pubsub
|
||||
return unless Danbooru.config.google_api_project
|
||||
#return unless Danbooru.config.google_api_project
|
||||
|
||||
PostUpdate.insert(id)
|
||||
end
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
class PostUpdate
|
||||
def self.insert(post_id)
|
||||
ActiveRecord::Base.execute_sql("insert into post_updates (post_id) values (?)", post_id)
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
end
|
||||
|
||||
def self.get
|
||||
ActiveRecord::Base.select_values_sql("delete from post_updates returning post_id")
|
||||
ActiveRecord::Base.select_values_sql("delete from post_updates returning post_id").uniq
|
||||
end
|
||||
|
||||
def self.push
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
$.post("<%= Danbooru.config.report_server %>/hits", {
|
||||
key: "<%= key %>",
|
||||
value: "<%= value %>",
|
||||
uid: <%= CurrentUser.user.id.to_s %>,
|
||||
<% if CurrentUser.user.is_platinum? %>
|
||||
uid: <%= CurrentUser.user.id %>,
|
||||
<% end %>
|
||||
sig: "<%= sig %>"
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user