Skip to content

Commit

Permalink
revert(collection): reduce scope of refactor due to flaky generic inh…
Browse files Browse the repository at this point in the history
…eritance
  • Loading branch information
caspiano committed Mar 9, 2020
1 parent 979edf4 commit db9633d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion shard.yml
@@ -1,5 +1,5 @@
name: rethinkdb-orm
version: 2.5.1
version: 2.5.2

authors:
- Caspian Baska <caspianbaska@gmail.com>
Expand Down
15 changes: 12 additions & 3 deletions src/rethinkdb-orm/utils/changefeed.cr
@@ -1,16 +1,25 @@
require "crystal-rethinkdb"

require "./collection"

module RethinkORM
# Wraps the Changefeed iterator and parses events
class Changefeed(T) < Collection(T)
class Changefeed(T)
include Iterator(T)
include Iterator::IteratorWrapper

enum Event
Created
Updated
Deleted
end

def initialize(@iterator : Iterator(RethinkDB::QueryResult))
end

def stop
@iterator.stop
super
end

def next
result = wrapped_next
if result == Iterator::Stop::INSTANCE
Expand Down

0 comments on commit db9633d

Please sign in to comment.