diff --git a/Socialmetrica.package/TweetsCollection.class/instance/store.st b/Socialmetrica.package/TweetsCollection.class/instance/store.st index e1be297..623dba7 100644 --- a/Socialmetrica.package/TweetsCollection.class/instance/store.st +++ b/Socialmetrica.package/TweetsCollection.class/instance/store.st @@ -2,7 +2,7 @@ accessing store ReStore isConnected ifFalse: [ self class storeDB]. "Starting the ReStore singleton." self tweets do: [:each | ReStore evaluateAsTransaction: [ - "TO DO: each isNotInDB ->"each store. - "TO DO: each user id isInDB? ifFalse: [ each user store ]" + each store. + each user isInDB ifFalse: [ each user store ] ] ]. \ No newline at end of file diff --git a/Socialmetrica.package/TwitterUser.class/instance/isInDB.st b/Socialmetrica.package/TwitterUser.class/instance/isInDB.st new file mode 100644 index 0000000..d533aef --- /dev/null +++ b/Socialmetrica.package/TwitterUser.class/instance/isInDB.st @@ -0,0 +1,7 @@ +accessing +isInDB + + (TwitterUser storedInstances select: [ :each | each id = self id ]) + ifEmpty: [ ^ false ] + ifNotEmpty: [ ^ true ]. + \ No newline at end of file