implement post change report

This commit is contained in:
r888888888
2016-09-07 14:35:35 -07:00
parent 62773852f7
commit e539fdecff
8 changed files with 21 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
module GoogleBigQuery
class PostVersion < Base
def find_removed(tag, limit = 1_000)
tag = escape(tag)
limit = limit.to_i
query("select id, post_id, updated_at, updater_id, updater_ip_addr, tags, added_tags, removed_tags, parent_id, rating, source from [#{data_set}.post_versions] where regexp_match(removed_tags, \"(?:^| )#{tag}(?:$| )\") order by updated_at desc limit #{limit}")
end
def find_added(tag, limit = 1_000)
tag = escape(tag)
limit = limit.to_i
query("select id, post_id, updated_at, updater_id, updater_ip_addr, tags, added_tags, removed_tags, parent_id, rating, source from [#{data_set}.post_versions] where regexp_match(added_tags, \"(?:^| )#{tag}(?:$| )\") order by updated_at desc limit #{limit}")
end
end
end