bit_player 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/bit_player/slide.rb +12 -0
- data/lib/bit_player/version.rb +1 -1
- metadata +2 -6
- data/spec/dummy/log/development.log +0 -92
- data/spec/dummy/log/test.log +0 -2654
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89302c4dac14c35f125bc588872ab07789873039
|
4
|
+
data.tar.gz: 47a8877e298438ebcea005d98f8fd222be78c655
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dedcb769358ecbb53a478688dd0fba652a8a6d2cd802deed87925b627d23d6b3f30ce6af8d2b9e5dd905eee6283fe6902fd6cf012a41a4c32318fd208038fffd
|
7
|
+
data.tar.gz: 946d025635d0dc4664971a22cf8eec125650c59f056b31318d8970fd1d6c5c2bfe5a23d52f79148fc5ec55ed0446ed91dcf7ff6ab8e72ea96913a7427d4aa8ad
|
@@ -12,6 +12,8 @@ module BitPlayer
|
|
12
12
|
validates :position, numericality: { greater_than_or_equal_to: 1 }
|
13
13
|
validates :position, uniqueness: { scope: :bit_player_slideshow_id }
|
14
14
|
|
15
|
+
before_destroy :push_to_be_deleted_slide_to_end
|
16
|
+
|
15
17
|
def self.update_positions(ids)
|
16
18
|
transaction do
|
17
19
|
connection.execute "SET CONSTRAINTS bit_player_slide_position DEFERRED"
|
@@ -32,5 +34,15 @@ module BitPlayer
|
|
32
34
|
space_after_headers: true
|
33
35
|
).render(body).html_safe
|
34
36
|
end
|
37
|
+
|
38
|
+
protected
|
39
|
+
|
40
|
+
def push_to_be_deleted_slide_to_end
|
41
|
+
slide_ids = slideshow.slide_ids
|
42
|
+
slide_ids.delete(id)
|
43
|
+
slide_ids.push(id)
|
44
|
+
slideshow.slides.update_positions(slide_ids)
|
45
|
+
end
|
46
|
+
|
35
47
|
end
|
36
48
|
end
|
data/lib/bit_player/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bit_player
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Carty-Fickes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -131,8 +131,6 @@ files:
|
|
131
131
|
- spec/dummy/config/locales/en.yml
|
132
132
|
- spec/dummy/config/routes.rb
|
133
133
|
- spec/dummy/db/schema.rb
|
134
|
-
- spec/dummy/log/development.log
|
135
|
-
- spec/dummy/log/test.log
|
136
134
|
- spec/dummy/public/404.html
|
137
135
|
- spec/dummy/public/422.html
|
138
136
|
- spec/dummy/public/500.html
|
@@ -197,8 +195,6 @@ test_files:
|
|
197
195
|
- spec/dummy/config/routes.rb
|
198
196
|
- spec/dummy/config.ru
|
199
197
|
- spec/dummy/db/schema.rb
|
200
|
-
- spec/dummy/log/development.log
|
201
|
-
- spec/dummy/log/test.log
|
202
198
|
- spec/dummy/public/404.html
|
203
199
|
- spec/dummy/public/422.html
|
204
200
|
- spec/dummy/public/500.html
|
@@ -1,92 +0,0 @@
|
|
1
|
-
[1m[36m (11.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
2
|
-
[1m[35m (4.4ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
3
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4
|
-
Migrating to CreateBitPlayerContentModules (20140305200438)
|
5
|
-
[1m[35m (0.3ms)[0m BEGIN
|
6
|
-
[1m[36m (12.0ms)[0m [1mCREATE TABLE "bit_player_content_modules" ("id" serial primary key, "title" character varying(255) NOT NULL, "context" character varying(255) NOT NULL, "position" integer DEFAULT 1 NOT NULL, "created_at" timestamp, "updated_at" timestamp) [0m
|
7
|
-
[1m[35mSQL (3.7ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140305200438"]]
|
8
|
-
[1m[36m (0.6ms)[0m [1mCOMMIT[0m
|
9
|
-
Migrating to CreateBitPlayerContentProviders (20140305201300)
|
10
|
-
[1m[35m (0.4ms)[0m BEGIN
|
11
|
-
[1m[36m (6.2ms)[0m [1mCREATE TABLE "bit_player_content_providers" ("id" serial primary key, "type" character varying(255) NOT NULL, "source_content_type" character varying(255), "source_content_id" integer, "bit_player_content_module_id" integer NOT NULL, "position" integer DEFAULT 1 NOT NULL, "created_at" timestamp, "updated_at" timestamp) [0m
|
12
|
-
[1m[35m (1.3ms)[0m CREATE INDEX "content_module_index" ON "bit_player_content_providers" ("bit_player_content_module_id")
|
13
|
-
[1m[36m (9.0ms)[0m [1m ALTER TABLE bit_player_content_providers
|
14
|
-
ADD CONSTRAINT fk_content_providers_modules
|
15
|
-
FOREIGN KEY (bit_player_content_module_id)
|
16
|
-
REFERENCES bit_player_content_modules(id)
|
17
|
-
[0m
|
18
|
-
[1m[35mSQL (1.7ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140305201300"]]
|
19
|
-
[1m[36m (1.3ms)[0m [1mCOMMIT[0m
|
20
|
-
Migrating to CreateBitPlayerParticipantStatuses (20140305232705)
|
21
|
-
[1m[35m (0.8ms)[0m BEGIN
|
22
|
-
[1m[36m (5.3ms)[0m [1mCREATE TABLE "bit_player_participant_statuses" ("id" serial primary key, "context" character varying(255), "module_position" integer, "provider_position" integer, "content_position" integer, "participant_id" integer NOT NULL, "created_at" timestamp, "updated_at" timestamp) [0m
|
23
|
-
[1m[35m (1.6ms)[0m CREATE INDEX "index_participant_statuses_on_participant_id" ON "bit_player_participant_statuses" ("participant_id")
|
24
|
-
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20140305232705"]]
|
25
|
-
[1m[35m (0.5ms)[0m COMMIT
|
26
|
-
Migrating to CreateBitPlayerSlideshows (20140305232706)
|
27
|
-
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
28
|
-
[1m[35m (3.6ms)[0m CREATE TABLE "bit_player_slideshows" ("id" serial primary key, "title" character varying(255) NOT NULL, "created_at" timestamp, "updated_at" timestamp)
|
29
|
-
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20140305232706"]]
|
30
|
-
[1m[35m (0.5ms)[0m COMMIT
|
31
|
-
Migrating to CreateBitPlayerSlides (20140305234327)
|
32
|
-
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
33
|
-
[1m[35m (5.5ms)[0m CREATE TABLE "bit_player_slides" ("id" serial primary key, "title" character varying(255), "body" text NOT NULL, "position" integer DEFAULT 1 NOT NULL, "bit_player_slideshow_id" integer NOT NULL, "type" character varying(255), "options" text, "is_title_visible" boolean DEFAULT 't' NOT NULL, "created_at" timestamp, "updated_at" timestamp)
|
34
|
-
[1m[36m (1.4ms)[0m [1mCREATE INDEX "index_bit_player_slides_on_bit_player_slideshow_id" ON "bit_player_slides" ("bit_player_slideshow_id")[0m
|
35
|
-
[1m[35m (2.9ms)[0m ALTER TABLE bit_player_slides
|
36
|
-
ADD CONSTRAINT fk_slides_slideshows
|
37
|
-
FOREIGN KEY (bit_player_slideshow_id)
|
38
|
-
REFERENCES bit_player_slideshows(id)
|
39
|
-
|
40
|
-
[1m[36m (1.8ms)[0m [1m ALTER TABLE bit_player_slides
|
41
|
-
ADD CONSTRAINT bit_player_slide_position UNIQUE (bit_player_slideshow_id, position)
|
42
|
-
DEFERRABLE INITIALLY IMMEDIATE
|
43
|
-
[0m
|
44
|
-
[1m[35mSQL (0.5ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140305234327"]]
|
45
|
-
[1m[36m (0.6ms)[0m [1mCOMMIT[0m
|
46
|
-
Migrating to CreateBitPlayerTools (20140402224913)
|
47
|
-
[1m[35m (0.5ms)[0m BEGIN
|
48
|
-
[1m[36m (4.3ms)[0m [1mCREATE TABLE "bit_player_tools" ("id" serial primary key, "title" character varying(255) NOT NULL, "position" integer, "is_home" boolean DEFAULT 'f' NOT NULL, "created_at" timestamp, "updated_at" timestamp) [0m
|
49
|
-
[1m[35m (1.2ms)[0m CREATE UNIQUE INDEX "index_bit_player_tools_on_title" ON "bit_player_tools" ("title")
|
50
|
-
[1m[36m (1.9ms)[0m [1mCREATE UNIQUE INDEX "index_bit_player_tools_on_position" ON "bit_player_tools" ("position")[0m
|
51
|
-
[1m[35mSQL (0.4ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140402224913"]]
|
52
|
-
[1m[36m (0.7ms)[0m [1mCOMMIT[0m
|
53
|
-
Migrating to ChangeModuleContextToTool (20140402225703)
|
54
|
-
[1m[35m (0.5ms)[0m BEGIN
|
55
|
-
[1m[36m (0.9ms)[0m [1mALTER TABLE "bit_player_content_modules" ADD COLUMN "bit_player_tool_id" integer[0m
|
56
|
-
[1m[35mBitPlayer::ContentModule Load (0.6ms)[0m SELECT "bit_player_content_modules".* FROM "bit_player_content_modules"
|
57
|
-
[1m[36m (0.6ms)[0m [1mALTER TABLE "bit_player_content_modules" ALTER "bit_player_tool_id" SET NOT NULL[0m
|
58
|
-
[1m[35m (1.0ms)[0m ALTER TABLE "bit_player_content_modules" DROP "context"
|
59
|
-
[1m[36m (2.7ms)[0m [1m ALTER TABLE bit_player_content_modules
|
60
|
-
ADD CONSTRAINT fk_content_modules_tools
|
61
|
-
FOREIGN KEY (bit_player_tool_id)
|
62
|
-
REFERENCES bit_player_tools(id)
|
63
|
-
[0m
|
64
|
-
[1m[35mSQL (0.5ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140402225703"]]
|
65
|
-
[1m[36m (0.5ms)[0m [1mCOMMIT[0m
|
66
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.5ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
67
|
-
[1m[36m (122.4ms)[0m [1mDROP DATABASE IF EXISTS "dummy_test"[0m
|
68
|
-
[1m[35m (253.8ms)[0m CREATE DATABASE "dummy_test" ENCODING = 'unicode'
|
69
|
-
[1m[36mSQL (3.3ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
70
|
-
[1m[35m (8.3ms)[0m CREATE TABLE "bit_player_content_modules" ("id" serial primary key, "title" character varying(255) NOT NULL, "position" integer DEFAULT 1 NOT NULL, "created_at" timestamp, "updated_at" timestamp, "bit_player_tool_id" integer NOT NULL)
|
71
|
-
[1m[36m (6.0ms)[0m [1mCREATE TABLE "bit_player_content_providers" ("id" serial primary key, "type" character varying(255) NOT NULL, "source_content_type" character varying(255), "source_content_id" integer, "bit_player_content_module_id" integer NOT NULL, "position" integer DEFAULT 1 NOT NULL, "created_at" timestamp, "updated_at" timestamp) [0m
|
72
|
-
[1m[35m (1.5ms)[0m CREATE INDEX "content_module_index" ON "bit_player_content_providers" USING btree ("bit_player_content_module_id")
|
73
|
-
[1m[36m (3.8ms)[0m [1mCREATE TABLE "bit_player_participant_statuses" ("id" serial primary key, "context" character varying(255), "module_position" integer, "provider_position" integer, "content_position" integer, "participant_id" integer NOT NULL, "created_at" timestamp, "updated_at" timestamp) [0m
|
74
|
-
[1m[35m (2.6ms)[0m CREATE INDEX "index_participant_statuses_on_participant_id" ON "bit_player_participant_statuses" USING btree ("participant_id")
|
75
|
-
[1m[36m (6.6ms)[0m [1mCREATE TABLE "bit_player_slides" ("id" serial primary key, "title" character varying(255), "body" text NOT NULL, "position" integer DEFAULT 1 NOT NULL, "bit_player_slideshow_id" integer NOT NULL, "type" character varying(255), "options" text, "is_title_visible" boolean DEFAULT 't' NOT NULL, "created_at" timestamp, "updated_at" timestamp) [0m
|
76
|
-
[1m[35m (1.7ms)[0m CREATE UNIQUE INDEX "bit_player_slide_position" ON "bit_player_slides" USING btree ("bit_player_slideshow_id", "position")
|
77
|
-
[1m[36m (1.4ms)[0m [1mCREATE INDEX "index_bit_player_slides_on_bit_player_slideshow_id" ON "bit_player_slides" USING btree ("bit_player_slideshow_id")[0m
|
78
|
-
[1m[35m (3.6ms)[0m CREATE TABLE "bit_player_slideshows" ("id" serial primary key, "title" character varying(255) NOT NULL, "created_at" timestamp, "updated_at" timestamp)
|
79
|
-
[1m[36m (4.0ms)[0m [1mCREATE TABLE "bit_player_tools" ("id" serial primary key, "title" character varying(255) NOT NULL, "position" integer, "is_home" boolean DEFAULT 'f' NOT NULL, "created_at" timestamp, "updated_at" timestamp) [0m
|
80
|
-
[1m[35m (1.4ms)[0m CREATE UNIQUE INDEX "index_bit_player_tools_on_position" ON "bit_player_tools" USING btree ("position")
|
81
|
-
[1m[36m (1.7ms)[0m [1mCREATE UNIQUE INDEX "index_bit_player_tools_on_title" ON "bit_player_tools" USING btree ("title")[0m
|
82
|
-
[1m[35m (1.6ms)[0m CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
|
83
|
-
[1m[36m (1.5ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
84
|
-
[1m[35m (0.5ms)[0m SELECT version FROM "schema_migrations"
|
85
|
-
[1m[36m (0.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140402225703')[0m
|
86
|
-
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140305200438')
|
87
|
-
[1m[36m (0.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140305201300')[0m
|
88
|
-
[1m[35m (0.4ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140305232705')
|
89
|
-
[1m[36m (0.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140305232706')[0m
|
90
|
-
[1m[35m (0.4ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20140305234327')
|
91
|
-
[1m[36m (0.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140402224913')[0m
|
92
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.4ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|