Sha256: 5b7f2ee1a98278fbcaf3ec4972ff34483ce6ec56c819ae9f48a3052aa2cfee40

Contents?: true

Size: 365 Bytes

Versions: 9

Compression:

Stored size: 365 Bytes

Contents

# A single word in the search index.
class PoseWord < ActiveRecord::Base
  has_many :pose_assignments

  def self.remove_unused_words progress_bar = nil
    PoseWord.find_each(:include => [:pose_assignments], :batch_size => 5000) do |pose_word|
      pose_word.delete if pose_word.pose_assignments.size == 0
      progress_bar.inc if progress_bar
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pose-1.1.0 lib/pose/models/pose_word.rb
pose-1.0.0 lib/pose_word.rb
pose-0.3 lib/pose_word.rb
pose-0.2.6 lib/pose_word.rb
pose-0.2.5 lib/pose_word.rb
pose-0.2.4 lib/pose_word.rb
pose-0.2.3 lib/pose_word.rb
pose-0.2.2 lib/pose_word.rb
pose-0.2.1 lib/pose_word.rb