Sha256: e8b4d37aadaa5c7fc9fe44c48451672030aac331b409e827683643e1df6689fb

Contents?: true

Size: 465 Bytes

Versions: 6

Compression:

Stored size: 465 Bytes

Contents

module GoogleSafeBrowsing
  class FullHash < ActiveRecord::Base
    self.table_name = 'gsb_full_hashes'

    def self.delete_subbed
      sub_join = <<-SQL
        INNER JOIN gsb_sub_shavars
        ON gsb_sub_shavars.add_chunk_number = gsb_full_hashes.add_chunk_number
        AND gsb_sub_shavars.list = gsb_full_hashes.list
      SQL

      hash_ids = joins(sub_join).pluck("distinct #{self.table_name}.id")
      where(id: hash_ids).delete_all
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
google_safe_browsing-0.6.5 lib/google_safe_browsing/full_hash.rb
google_safe_browsing-0.6.4 lib/google_safe_browsing/full_hash.rb
google_safe_browsing-0.6.3 lib/google_safe_browsing/full_hash.rb
google_safe_browsing-0.6.2 lib/google_safe_browsing/full_hash.rb
google_safe_browsing-0.6.1 lib/google_safe_browsing/full_hash.rb
google_safe_browsing-0.6.0 lib/google_safe_browsing/full_hash.rb