app/models/collection_job.rb
# Returns new collection items in target collection:
Returns new collection items in target collection.
Returns new collection items in target collection .
def watch_inserts(&block)
    last_id = CollectionItem.maximum('id')
    yield
    if last_id
      CollectionItem.where(['id > ? AND collection_id IN (?)', last_id, collections.map(&:id)])
    else 
      CollectionItem.where(['collection_id IN (?)', collections.map(&:id)])
    end
  end
def watch_inserts ( & block ) last_id = CollectionItem . maximum ( 'id' ) yield if last_id CollectionItem . where ( [ 'id > ? AND collection_id IN (?)' , last_id , collections . map ( & :id ) ] ) else CollectionItem . where ( [ 'collection_id IN (?)' , collections . map ( & :id ) ] ) end end
Returns new collection items in target collection:
Returns new collection items in target collection :
# Really only useful in tests:
block
<not_specific>