Sha256: 97597b8616233f2001282c7ba51a1a981dc157f4d846719d3e2cfe9a523b73f5
Contents?: true
Size: 366 Bytes
Versions: 35
Compression:
Stored size: 366 Bytes
Contents
class TagJob < Struct.new(:tag, :people_ids) def initialize(tag, people) self.tag = tag self.people_ids = Array.wrap(people).map(&:id) end def perform Person.where(:id => self.people_ids).each do |p| p.tag_list << self.tag unless p.tag_list.include? self.tag p.skip_commit = true p.save end Sunspot.delay.commit end end
Version data entries
35 entries across 35 versions & 1 rubygems