timeful 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20755247404f8c6000c30698ed23a7feb91c3813
4
- data.tar.gz: 7ecce79736008b10d33f9e597c5f991b8094441a
3
+ metadata.gz: 1e68198dc675d58a7bf9c9fff272d3eb0b6a7670
4
+ data.tar.gz: 29213ad0187262a0ccd839c71bcb7b23fdc4ef62
5
5
  SHA512:
6
- metadata.gz: 14f7ad8b622872f9090ecc5edbe59e70d11a4d5033fe6e55b5d7abfc5459542944dc1e8383aee8577f27ba56e4219c625d1e83041271f261f16c05e87cb15360
7
- data.tar.gz: cf6a524b2cb7579be3a168f1b1ad43aab8af66aeaa75417ef4691d4b9c87cf22007cbb97809a949e7b10bb098ac03385fc8c24bce1e265c5e681e2ba6f87f9f5
6
+ metadata.gz: eb31c2e9c51d929afcf1e652ed8c13daef738941fe307acca90f190b44e87c27eaf4a093d7f7d6f7ffc57bd850e8f30c7629ee5bb1856808d7f125f843e559ee
7
+ data.tar.gz: b5ccba267919bb207acd5fa7b6d33102e58c4c831cc69adeca920c4ec85e389b9accd52fec54597436f28c9f29532e18e1dd53fae12e0c775a6624a0fec2f8c4
data/README.md CHANGED
@@ -65,8 +65,8 @@ end
65
65
 
66
66
  Timeful revolves around three core concepts:
67
67
 
68
- - **Activity**: An _action_ taken by an _actor_ on an _object_. _Metadata_ can also be attached to
69
- activities. An example would be "John Doe (actor) wrote (action) a comment (object)."
68
+ - **Activity**: An _action_ taken by an _actor_ on an _target_. _Metadata_ can also be attached to
69
+ activities. An example would be "John Doe (actor) wrote (action) a comment (target)."
70
70
  - **Feed**: A collection of activities that should be accessible by a specific user.
71
71
  - **Feed item**: The instance of an activity in a user's feed.
72
72
 
@@ -81,7 +81,7 @@ Here's an example activity:
81
81
  ```ruby
82
82
  class CommentActivity < Timeful::Activity
83
83
  def subscribers
84
- [object.post.author]
84
+ [target.post.author]
85
85
  end
86
86
  end
87
87
  ```
@@ -89,7 +89,7 @@ end
89
89
  Now, you can publish the `comment` activity:
90
90
 
91
91
  ```ruby
92
- user.publish_activity :comment, object: comment
92
+ user.publish_activity :comment, target: comment
93
93
  ```
94
94
 
95
95
  This will create an `Activity` and link it to the author's feed through a `FeedItem`:
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
  module Timeful
3
3
  # An activity is something that happens in your application. It's comprised of an actor, an
4
- # action and an object.
4
+ # action and an target.
5
5
  #
6
- # An example activity might be: "John Doe (actor) published (action) a new post (object)."
6
+ # An example activity might be: "John Doe (actor) published (action) a new post (target)."
7
7
  #
8
8
  # @author Alessandro Desantis
9
9
  #
@@ -12,12 +12,12 @@ module Timeful
12
12
  # @example
13
13
  # class CommentCreatedActivity < Timeful::Activity
14
14
  # def subscribers
15
- # [object.post.author]
15
+ # [target.post.author]
16
16
  # end
17
17
  # end
18
18
  class Activity < ApplicationRecord
19
19
  belongs_to :actor, polymorphic: true
20
- belongs_to :object, polymorphic: true
20
+ belongs_to :target, polymorphic: true
21
21
 
22
22
  # Returns the users that subscribe to this activity. A {FeedItem} linked to the activity will
23
23
  # be created for these users.
@@ -0,0 +1,6 @@
1
+ class RenameObjectToTargetInActivities < ActiveRecord::Migration[5.0]
2
+ def change
3
+ rename_column :timeful_activities, :object_id, :target_id
4
+ rename_column :timeful_activities, :object_type, :target_type
5
+ end
6
+ end
@@ -13,14 +13,14 @@ module Timeful
13
13
  # Publishes an activity and creates a feed item for each subscriber.
14
14
  #
15
15
  # @param action [Symbol] the action (or activity type) to create
16
- # @param object [ActiveRecord::Base] the object the action was taken upon
16
+ # @param target [ActiveRecord::Base] the target the action was taken upon
17
17
  #
18
18
  # @return [Activity] the created activity
19
19
  #
20
20
  # @example
21
- # actor.publish_activity :post_created, object: post # => #<PostCreatedActivity>
22
- def publish_activity(action, object:)
23
- activity = activity_klass(action).create! object: object, actor: self
21
+ # actor.publish_activity :post_created, target: post # => #<PostCreatedActivity>
22
+ def publish_activity(action, target:)
23
+ activity = activity_klass(action).create! target: target, actor: self
24
24
  DeliverActivityToSubscribersJob.perform_later activity
25
25
  end
26
26
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Timeful
3
- VERSION = '1.1.0'
3
+ VERSION = '2.0.0'
4
4
  end
@@ -0,0 +1,7 @@
1
+ # This migration comes from timeful (originally 20160928114427)
2
+ class RenameObjectToTargetInActivities < ActiveRecord::Migration[5.0]
3
+ def change
4
+ rename_column :timeful_activities, :object_id, :target_id
5
+ rename_column :timeful_activities, :object_type, :target_type
6
+ end
7
+ end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20160928113645) do
13
+ ActiveRecord::Schema.define(version: 20160928114457) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
@@ -22,14 +22,14 @@ ActiveRecord::Schema.define(version: 20160928113645) do
22
22
 
23
23
  create_table "timeful_activities", force: :cascade do |t|
24
24
  t.string "type", null: false
25
- t.string "object_type", null: false
26
- t.string "object_id", null: false
25
+ t.string "target_type", null: false
26
+ t.string "target_id", null: false
27
27
  t.string "actor_type", null: false
28
28
  t.string "actor_id", null: false
29
29
  t.datetime "created_at", null: false
30
30
  t.datetime "updated_at", null: false
31
31
  t.index ["actor_type", "actor_id"], name: "index_timeful_activities_on_actor_type_and_actor_id", using: :btree
32
- t.index ["object_type", "object_id"], name: "index_timeful_activities_on_object_type_and_object_id", using: :btree
32
+ t.index ["target_type", "target_id"], name: "index_timeful_activities_on_target_type_and_target_id", using: :btree
33
33
  end
34
34
 
35
35
  create_table "timeful_feed_items", force: :cascade do |t|
@@ -496,4 +496,74 @@ WHERE c.contype = 'f'
496
496
  AND t1.relname = 'users'
497
497
  AND t3.nspname = ANY (current_schemas(false))
498
498
  ORDER BY c.conname
499
+ 
500
+  (0.5ms) SELECT pg_try_advisory_lock(339456620476877820);
501
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
502
+ Migrating to RenameObjectToTargetInActivities (20160928114457)
503
+  (0.4ms) BEGIN
504
+  (0.6ms) ALTER TABLE "activities" RENAME COLUMN "object_id" TO "target_id"
505
+  (0.2ms) ROLLBACK
506
+  (0.4ms) SELECT pg_advisory_unlock(339456620476877820)
507
+  (0.2ms) SELECT pg_try_advisory_lock(339456620476877820);
508
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
509
+ Migrating to RenameObjectToTargetInActivities (20160928114457)
510
+  (0.2ms) BEGIN
511
+  (0.3ms) ALTER TABLE "timeful_activities" RENAME COLUMN "object_id" TO "target_id"
512
+  (0.2ms) ALTER INDEX "index_timeful_activities_on_object_type_and_object_id" RENAME TO "index_timeful_activities_on_object_type_and_target_id"
513
+  (0.3ms) ALTER TABLE "timeful_activities" RENAME COLUMN "object_type" TO "target_type"
514
+  (0.2ms) ALTER INDEX "index_timeful_activities_on_object_type_and_target_id" RENAME TO "index_timeful_activities_on_target_type_and_target_id"
515
+ SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20160928114457"]]
516
+  (2.6ms) COMMIT
517
+ ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
518
+  (0.3ms) BEGIN
519
+  (0.2ms) COMMIT
520
+  (0.3ms) SELECT pg_advisory_unlock(339456620476877820)
521
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
522
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
523
+ FROM pg_constraint c
524
+ JOIN pg_class t1 ON c.conrelid = t1.oid
525
+ JOIN pg_class t2 ON c.confrelid = t2.oid
526
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
527
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
528
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
529
+ WHERE c.contype = 'f'
530
+ AND t1.relname = 'posts'
531
+ AND t3.nspname = ANY (current_schemas(false))
532
+ ORDER BY c.conname
533
+ 
534
+  (1.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
535
+ FROM pg_constraint c
536
+ JOIN pg_class t1 ON c.conrelid = t1.oid
537
+ JOIN pg_class t2 ON c.confrelid = t2.oid
538
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
539
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
540
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
541
+ WHERE c.contype = 'f'
542
+ AND t1.relname = 'timeful_activities'
543
+ AND t3.nspname = ANY (current_schemas(false))
544
+ ORDER BY c.conname
545
+ 
546
+  (1.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
547
+ FROM pg_constraint c
548
+ JOIN pg_class t1 ON c.conrelid = t1.oid
549
+ JOIN pg_class t2 ON c.confrelid = t2.oid
550
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
551
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
552
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
553
+ WHERE c.contype = 'f'
554
+ AND t1.relname = 'timeful_feed_items'
555
+ AND t3.nspname = ANY (current_schemas(false))
556
+ ORDER BY c.conname
557
+ 
558
+  (1.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
559
+ FROM pg_constraint c
560
+ JOIN pg_class t1 ON c.conrelid = t1.oid
561
+ JOIN pg_class t2 ON c.confrelid = t2.oid
562
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
563
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
564
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
565
+ WHERE c.contype = 'f'
566
+ AND t1.relname = 'users'
567
+ AND t3.nspname = ANY (current_schemas(false))
568
+ ORDER BY c.conname
499
569
  
@@ -4267,3 +4267,183 @@ FOREIGN KEY ("activity_id")
4267
4267
   (0.6ms) BEGIN
4268
4268
   (0.9ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4269
4269
   (3.6ms) COMMIT
4270
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
4271
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
4272
+  (0.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
4273
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
4274
+ ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
4275
+  (0.4ms) BEGIN
4276
+ SQL (0.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", 2016-09-28 11:48:06 UTC], ["updated_at", 2016-09-28 11:48:06 UTC]]
4277
+  (2.4ms) COMMIT
4278
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
4279
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
4280
+  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
4281
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
4282
+  (0.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
4283
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
4284
+  (0.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
4285
+  (118.8ms) DROP DATABASE IF EXISTS "timeful_test"
4286
+  (359.6ms) CREATE DATABASE "timeful_test" ENCODING = 'utf8'
4287
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
4288
+  (7.3ms) CREATE TABLE "posts" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
4289
+  (7.4ms) CREATE TABLE "timeful_activities" ("id" serial primary key, "type" character varying NOT NULL, "target_type" character varying NOT NULL, "target_id" character varying NOT NULL, "actor_type" character varying NOT NULL, "actor_id" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
4290
+  (3.5ms) CREATE INDEX "index_timeful_activities_on_actor_type_and_actor_id" ON "timeful_activities" USING btree ("actor_type", "actor_id")
4291
+  (3.3ms) CREATE INDEX "index_timeful_activities_on_target_type_and_target_id" ON "timeful_activities" USING btree ("target_type", "target_id")
4292
+  (6.4ms) CREATE TABLE "timeful_feed_items" ("id" serial primary key, "subscriber_type" character varying NOT NULL, "subscriber_id" character varying NOT NULL, "activity_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
4293
+  (3.6ms) CREATE INDEX "index_timeful_feed_items_on_subscriber_type_and_subscriber_id" ON "timeful_feed_items" USING btree ("subscriber_type", "subscriber_id")
4294
+  (4.4ms) CREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
4295
+  (2.9ms) ALTER TABLE "timeful_feed_items" ADD CONSTRAINT "fk_rails_9bc442415c"
4296
+ FOREIGN KEY ("activity_id")
4297
+ REFERENCES "timeful_activities" ("id")
4298
+ ON DELETE CASCADE
4299
+  (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
4300
+  (0.6ms) SELECT version FROM "schema_migrations"
4301
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20160928114457')
4302
+  (1.2ms) INSERT INTO schema_migrations (version) VALUES ('20160927160031'), ('20160928113645'), ('20160928104634'), ('20160927141815'), ('20160927155215'), ('20160927160026');
4303
+
4304
+ 
4305
+  (6.6ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
4306
+ ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
4307
+  (0.4ms) BEGIN
4308
+ SQL (0.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", 2016-09-28 11:48:12 UTC], ["updated_at", 2016-09-28 11:48:12 UTC]]
4309
+  (1.3ms) COMMIT
4310
+ ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
4311
+  (0.4ms) BEGIN
4312
+  (0.3ms) COMMIT
4313
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
4314
+  (0.3ms) BEGIN
4315
+  (0.8ms) ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4316
+  (5.1ms) COMMIT
4317
+  (3.0ms)  SELECT schemaname || '.' || tablename
4318
+ FROM pg_tables
4319
+ WHERE
4320
+ tablename !~ '_prt_' AND
4321
+ tablename <> 'schema_migrations' AND
4322
+ schemaname = ANY (current_schemas(false))
4323
+ 
4324
+  (1.8ms) select table_name from information_schema.views where table_schema = 'timeful_test'
4325
+  (24.5ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4326
+  (0.3ms) BEGIN
4327
+  (0.5ms) ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4328
+  (0.9ms) COMMIT
4329
+  (0.3ms) BEGIN
4330
+  (0.6ms) ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4331
+  (1.0ms) COMMIT
4332
+  (19.0ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4333
+  (0.3ms) BEGIN
4334
+  (0.5ms) ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4335
+  (1.0ms) COMMIT
4336
+  (0.2ms) BEGIN
4337
+  (0.5ms) ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4338
+  (0.9ms) COMMIT
4339
+  (20.7ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4340
+  (0.2ms) BEGIN
4341
+  (1.0ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4342
+  (1.1ms) COMMIT
4343
+ [ActiveJob] [Timeful::DeliverActivityToSubscribersJob] [528c147b-fc35-4d57-910c-8d1b1279d621] Performing Timeful::DeliverActivityToSubscribersJob from Test(default) with arguments: #<GlobalID:0x00000003a95378 @uri=#<URI::GID gid://dummy/Timeful::Activity/1003>>
4344
+ [ActiveJob] [Timeful::DeliverActivityToSubscribersJob] [528c147b-fc35-4d57-910c-8d1b1279d621] Performed Timeful::DeliverActivityToSubscribersJob from Test(default) in 0.45ms
4345
+  (0.3ms) BEGIN
4346
+  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4347
+  (2.1ms) COMMIT
4348
+  (19.8ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4349
+  (0.3ms) BEGIN
4350
+  (0.6ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4351
+  (1.1ms) COMMIT
4352
+  (0.3ms) BEGIN
4353
+  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4354
+  (1.0ms) COMMIT
4355
+  (19.5ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4356
+  (0.6ms) BEGIN
4357
+  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4358
+  (10.0ms) COMMIT
4359
+  (0.4ms) BEGIN
4360
+  (0.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4361
+  (1.2ms) COMMIT
4362
+  (34.5ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4363
+  (0.4ms) BEGIN
4364
+  (0.6ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4365
+  (1.0ms) COMMIT
4366
+  (0.3ms) BEGIN
4367
+ SQL (0.9ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4368
+  (1.1ms) COMMIT
4369
+  (0.8ms) BEGIN
4370
+ SQL (4.8ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4371
+ SQL (1.6ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4372
+ SQL (0.8ms) INSERT INTO "timeful_activities" ("type", "target_type", "target_id", "actor_type", "actor_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "PostActivity"], ["target_type", "Post"], ["target_id", "1"], ["actor_type", "User"], ["actor_id", "2"], ["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4373
+ SQL (1.1ms) INSERT INTO "timeful_feed_items" ("subscriber_type", "subscriber_id", "activity_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["subscriber_type", "User"], ["subscriber_id", "1"], ["activity_id", 1], ["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4374
+  (1.0ms) COMMIT
4375
+ Timeful::FeedItem Load (0.5ms) SELECT "timeful_feed_items".* FROM "timeful_feed_items" WHERE "timeful_feed_items"."subscriber_id" = $1 AND "timeful_feed_items"."subscriber_type" = $2 ORDER BY "timeful_feed_items"."created_at" DESC [["subscriber_id", "1"], ["subscriber_type", "User"]]
4376
+  (0.3ms) BEGIN
4377
+  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4378
+  (1.1ms) COMMIT
4379
+  (20.5ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4380
+  (0.2ms) BEGIN
4381
+  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4382
+  (0.8ms) COMMIT
4383
+  (0.2ms) BEGIN
4384
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4385
+  (1.0ms) COMMIT
4386
+  (0.3ms) BEGIN
4387
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4388
+ SQL (0.6ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4389
+ SQL (0.9ms) INSERT INTO "timeful_activities" ("type", "target_type", "target_id", "actor_type", "actor_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "PostActivity"], ["target_type", "Post"], ["target_id", "1"], ["actor_type", "User"], ["actor_id", "2"], ["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4390
+ SQL (0.9ms) INSERT INTO "timeful_feed_items" ("subscriber_type", "subscriber_id", "activity_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["subscriber_type", "User"], ["subscriber_id", "1"], ["activity_id", 1], ["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4391
+  (1.0ms) COMMIT
4392
+  (0.2ms) BEGIN
4393
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4394
+ SQL (0.5ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4395
+ SQL (0.4ms) INSERT INTO "timeful_activities" ("type", "target_type", "target_id", "actor_type", "actor_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "PostActivity"], ["target_type", "Post"], ["target_id", "2"], ["actor_type", "User"], ["actor_id", "3"], ["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4396
+ SQL (0.5ms) INSERT INTO "timeful_feed_items" ("subscriber_type", "subscriber_id", "activity_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["subscriber_type", "User"], ["subscriber_id", "1"], ["activity_id", 2], ["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4397
+  (1.0ms) COMMIT
4398
+ Timeful::FeedItem Load (1.3ms) SELECT "timeful_feed_items".* FROM "timeful_feed_items" WHERE "timeful_feed_items"."subscriber_id" = $1 AND "timeful_feed_items"."subscriber_type" = $2 ORDER BY "timeful_feed_items"."created_at" DESC [["subscriber_id", "1"], ["subscriber_type", "User"]]
4399
+  (1.9ms) BEGIN
4400
+  (3.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4401
+  (1.1ms) COMMIT
4402
+  (24.1ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4403
+  (0.2ms) BEGIN
4404
+  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4405
+  (0.9ms) COMMIT
4406
+  (0.3ms) BEGIN
4407
+  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4408
+  (1.0ms) COMMIT
4409
+  (20.3ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4410
+  (0.2ms) BEGIN
4411
+  (0.9ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4412
+  (6.6ms) COMMIT
4413
+  (1.4ms) SELECT COUNT(*) FROM "timeful_activities" WHERE "timeful_activities"."type" IN ('PostActivity')
4414
+  (0.3ms) BEGIN
4415
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4416
+  (1.1ms) COMMIT
4417
+  (0.4ms) BEGIN
4418
+ SQL (0.6ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4419
+  (1.0ms) COMMIT
4420
+  (0.9ms) BEGIN
4421
+ SQL (0.8ms) INSERT INTO "timeful_activities" ("type", "target_type", "target_id", "actor_type", "actor_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "PostActivity"], ["target_type", "Post"], ["target_id", "1"], ["actor_type", "User"], ["actor_id", "1"], ["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4422
+  (2.6ms) COMMIT
4423
+ [ActiveJob] Enqueued Timeful::DeliverActivityToSubscribersJob (Job ID: 12a3117f-a187-40ef-9efa-01a9f2e7d2a8) to Test(timeful) with arguments: #<GlobalID:0x00000003aec6f0 @uri=#<URI::GID gid://dummy/PostActivity/1>>
4424
+  (2.6ms) SELECT COUNT(*) FROM "timeful_activities" WHERE "timeful_activities"."type" IN ('PostActivity')
4425
+  (0.4ms) BEGIN
4426
+  (1.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4427
+  (3.1ms) COMMIT
4428
+  (24.4ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4429
+  (0.2ms) BEGIN
4430
+  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4431
+  (0.9ms) COMMIT
4432
+  (0.2ms) BEGIN
4433
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4434
+  (1.0ms) COMMIT
4435
+  (0.3ms) BEGIN
4436
+ SQL (0.8ms) INSERT INTO "posts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4437
+  (1.1ms) COMMIT
4438
+  (0.3ms) BEGIN
4439
+ SQL (0.8ms) INSERT INTO "timeful_activities" ("type", "target_type", "target_id", "actor_type", "actor_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "PostActivity"], ["target_type", "Post"], ["target_id", "1"], ["actor_type", "User"], ["actor_id", "1"], ["created_at", 2016-09-28 11:48:13 UTC], ["updated_at", 2016-09-28 11:48:13 UTC]]
4440
+  (1.0ms) COMMIT
4441
+ [ActiveJob] Enqueued Timeful::DeliverActivityToSubscribersJob (Job ID: 96eef781-0577-413d-8d0a-012a9baf7f0f) to Test(timeful) with arguments: #<GlobalID:0x00000003a61690 @uri=#<URI::GID gid://dummy/PostActivity/1>>
4442
+ PostActivity Load (0.6ms) SELECT "timeful_activities".* FROM "timeful_activities" WHERE "timeful_activities"."type" IN ('PostActivity') AND "timeful_activities"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
4443
+  (0.3ms) BEGIN
4444
+  (0.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "timeful_activities" DISABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4445
+  (1.0ms) COMMIT
4446
+  (33.9ms) TRUNCATE TABLE "public"."posts", "public"."users", "public"."timeful_activities", "public"."timeful_feed_items", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
4447
+  (0.4ms) BEGIN
4448
+  (0.8ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "timeful_activities" ENABLE TRIGGER ALL;ALTER TABLE "timeful_feed_items" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
4449
+  (0.9ms) COMMIT
@@ -1,12 +1,12 @@
1
1
  example_id | status | run_time |
2
2
  -------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/jobs/timeful/deliver_activity_to_subscribers_job_spec.rb[1:1] | passed | 0.04836 seconds |
4
- ./spec/models/timeful/activity_spec.rb[1:1] | passed | 0.09059 seconds |
5
- ./spec/models/timeful/feed_item_spec.rb[1:1] | passed | 0.03481 seconds |
6
- ./spec/timeful/model/actor_spec.rb[1:1:1] | passed | 0.07676 seconds |
7
- ./spec/timeful/model/actor_spec.rb[1:1:2] | passed | 0.05446 seconds |
8
- ./spec/timeful/model/subscriber_spec.rb[1:1:1] | passed | 0.06242 seconds |
9
- ./spec/timeful/model/subscriber_spec.rb[1:1:2] | passed | 0.08846 seconds |
10
- ./spec/timeful/relation_proxy_spec.rb[1:1:1:1] | passed | 0.03358 seconds |
11
- ./spec/timeful/relation_proxy_spec.rb[1:1:2:1] | passed | 0.03147 seconds |
12
- ./spec/timeful/timeful_spec.rb[1:1:1] | passed | 0.05844 seconds |
3
+ ./spec/jobs/timeful/deliver_activity_to_subscribers_job_spec.rb[1:1] | passed | 0.11858 seconds |
4
+ ./spec/models/timeful/activity_spec.rb[1:1] | passed | 0.03826 seconds |
5
+ ./spec/models/timeful/feed_item_spec.rb[1:1] | passed | 0.03574 seconds |
6
+ ./spec/timeful/model/actor_spec.rb[1:1:1] | passed | 0.06665 seconds |
7
+ ./spec/timeful/model/actor_spec.rb[1:1:2] | passed | 0.06035 seconds |
8
+ ./spec/timeful/model/subscriber_spec.rb[1:1:1] | passed | 0.07969 seconds |
9
+ ./spec/timeful/model/subscriber_spec.rb[1:1:2] | passed | 0.0681 seconds |
10
+ ./spec/timeful/relation_proxy_spec.rb[1:1:1:1] | passed | 0.02877 seconds |
11
+ ./spec/timeful/relation_proxy_spec.rb[1:1:2:1] | passed | 0.02981 seconds |
12
+ ./spec/timeful/timeful_spec.rb[1:1:1] | passed | 0.04947 seconds |
@@ -3,6 +3,6 @@ FactoryGirl.define do
3
3
  factory :activity, class: 'Timeful::Activity' do
4
4
  type 'PostActivity'
5
5
  association :actor, strategy: :build, factory: :user
6
- association :object, strategy: :build, factory: :post
6
+ association :target, strategy: :build, factory: :post
7
7
  end
8
8
  end
@@ -7,13 +7,13 @@ RSpec.describe Timeful::Model::Actor do
7
7
  describe '#publish_activity' do
8
8
  it 'creates a new activity' do
9
9
  expect {
10
- subject.publish_activity :post, object: post
10
+ subject.publish_activity :post, target: post
11
11
  }.to change(PostActivity, :count).by(1)
12
12
  end
13
13
 
14
14
  it 'creates a feed item for subscribers' do
15
15
  expect {
16
- subject.publish_activity :post, object: post
16
+ subject.publish_activity :post, target: post
17
17
  }.to enqueue_job(Timeful::DeliverActivityToSubscribersJob)
18
18
  end
19
19
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe Timeful::RelationProxy do
3
- subject { described_class.new(object) }
3
+ subject { described_class.new(target) }
4
4
 
5
5
  describe '#find_each' do
6
- context 'when the object responds to #find_each' do
7
- let(:object) do
6
+ context 'when the target responds to #find_each' do
7
+ let(:target) do
8
8
  Class.new do
9
9
  def find_each
10
10
  yield 1
@@ -12,13 +12,13 @@ RSpec.describe Timeful::RelationProxy do
12
12
  end.new
13
13
  end
14
14
 
15
- it 'calls #find_each on the object' do
15
+ it 'calls #find_each on the target' do
16
16
  expect { |block| subject.find_each(&block) }.to yield_with_args(1)
17
17
  end
18
18
  end
19
19
 
20
- context 'when the object does not respond to #find_each' do
21
- let(:object) do
20
+ context 'when the target does not respond to #find_each' do
21
+ let(:target) do
22
22
  Class.new do
23
23
  def each
24
24
  yield 1
@@ -26,7 +26,7 @@ RSpec.describe Timeful::RelationProxy do
26
26
  end.new
27
27
  end
28
28
 
29
- it 'calls #each on the object' do
29
+ it 'calls #each on the target' do
30
30
  expect { |block| subject.find_each(&block) }.to yield_with_args(1)
31
31
  end
32
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timeful
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Desantis
@@ -175,6 +175,7 @@ files:
175
175
  - db/migrate/20160927154912_create_timeful_feed_items.rb
176
176
  - db/migrate/20160928104602_rename_feedable_to_subscriber_in_feed_items.rb
177
177
  - db/migrate/20160928113515_change_foreign_ids_to_string.rb
178
+ - db/migrate/20160928114427_rename_object_to_target_in_activities.rb
178
179
  - lib/generators/timeful/install_generator.rb
179
180
  - lib/timeful.rb
180
181
  - lib/timeful/engine.rb
@@ -223,6 +224,7 @@ files:
223
224
  - spec/dummy/db/migrate/20160927160031_create_posts.rb
224
225
  - spec/dummy/db/migrate/20160928104634_rename_feedable_to_subscriber_in_feed_items.timeful.rb
225
226
  - spec/dummy/db/migrate/20160928113645_change_foreign_ids_to_string.timeful.rb
227
+ - spec/dummy/db/migrate/20160928114457_rename_object_to_target_in_activities.timeful.rb
226
228
  - spec/dummy/db/schema.rb
227
229
  - spec/dummy/log/development.log
228
230
  - spec/dummy/log/test.log
@@ -296,6 +298,7 @@ test_files:
296
298
  - spec/dummy/db/migrate/20160927160031_create_posts.rb
297
299
  - spec/dummy/db/migrate/20160928113645_change_foreign_ids_to_string.timeful.rb
298
300
  - spec/dummy/db/migrate/20160928104634_rename_feedable_to_subscriber_in_feed_items.timeful.rb
301
+ - spec/dummy/db/migrate/20160928114457_rename_object_to_target_in_activities.timeful.rb
299
302
  - spec/dummy/db/migrate/20160927141815_create_timeful_activities.timeful.rb
300
303
  - spec/dummy/db/migrate/20160927155215_create_timeful_feed_items.timeful.rb
301
304
  - spec/dummy/db/migrate/20160927160026_create_users.rb