polymorphic_render 0.0.1 → 0.1.0
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/README.md +19 -0
- data/app/helpers/polymorphic_render/application_helper.rb +1 -1
- data/lib/polymorphic_render/version.rb +1 -1
- data/test/dummy/app/views/posts/_post_super_admin.html.erb +1 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +5 -14
- data/test/dummy/log/test.log +227 -116
- data/test/helpers/application_helper_test.rb +5 -0
- metadata +18 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14731099d4f17a9ea2cc030dcfd544ccde47f10e
|
4
|
+
data.tar.gz: 942a5e4d932dbab32f31ff35d61862a693c26f0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e81afe5ee7ad1c429b6aa8f0dc60078b54e30a9ba795d7ee4c7212142d8ac31a9db3b3a1ef97bb89c9c7b8ad40236b98c6ceb84bf8a6da1906fac298f46424f8
|
7
|
+
data.tar.gz: 617b1542db7002bba88ef79592c9604223b999c17a3fd72f552c1ac7b57269a1e43b5e9a6e305976d29a2ada4dc48a4137dc8a77d3b0b880696f7f7046968884
|
data/README.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
PolymorphicRender
|
2
2
|
=================
|
3
3
|
|
4
|
+
Installing
|
5
|
+
----------
|
6
|
+
|
7
|
+
Add in your gemfile
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'polymorphic_render'
|
11
|
+
```
|
12
|
+
|
4
13
|
Using
|
5
14
|
-----
|
6
15
|
|
@@ -33,6 +42,16 @@ But if you write:
|
|
33
42
|
|
34
43
|
It renders `views/models/_model_admin` partial and passes `model` local variable into.
|
35
44
|
|
45
|
+
Array can be passed as second parameter:
|
46
|
+
|
47
|
+
```haml
|
48
|
+
= polymorphic_render @model, [:super, :admin]
|
49
|
+
-# or
|
50
|
+
= polymorphic_render @models, [:super, :admin]
|
51
|
+
```
|
52
|
+
|
53
|
+
It renders `views/models/_model_super_admin` partial and passes `model` local variable into.
|
54
|
+
|
36
55
|
When it's useful?
|
37
56
|
-----------------
|
38
57
|
|
@@ -2,7 +2,7 @@ module PolymorphicRender
|
|
2
2
|
module ApplicationHelper
|
3
3
|
def polymorphic_render(resource, suffix = nil)
|
4
4
|
if resource.is_a? ActiveRecord::Base
|
5
|
-
path = [resource.to_partial_path, suffix
|
5
|
+
path = [resource.to_partial_path, *Array(suffix)].select(&:present?).join('_')
|
6
6
|
name = File.basename(resource.to_partial_path)
|
7
7
|
render partial: path, object: resource, as: name
|
8
8
|
else
|
@@ -0,0 +1 @@
|
|
1
|
+
Destroy: <%= post.title %>
|
Binary file
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -1,14 +1,5 @@
|
|
1
|
-
[1m[36m (1.
|
2
|
-
[1m[35m (
|
3
|
-
[1m[
|
4
|
-
|
5
|
-
[1m[
|
6
|
-
[1m[36m (1.1ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
7
|
-
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140303085238"]]
|
8
|
-
[1m[36m (1.1ms)[0m [1mcommit transaction[0m
|
9
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
10
|
-
[1m[36m (1.2ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
11
|
-
[1m[35m (1.2ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
12
|
-
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
13
|
-
[1m[35m (0.2ms)[0m SELECT version FROM "schema_migrations"
|
14
|
-
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140303085238')[0m
|
1
|
+
[1m[36m (1.8ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
2
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
3
|
+
[1m[36m (0.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
5
|
+
[1m[36m (0.8ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140303085238')[0m
|
data/test/dummy/log/test.log
CHANGED
@@ -1,203 +1,314 @@
|
|
1
|
-
[1m[36m (0.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
[1m[35m (0.
|
6
|
-
[1m[36m (0.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
[1m[35m (0.
|
11
|
-
[1m[36m (0.
|
1
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2
|
+
------------------------------------------------------------------------------
|
3
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_collection_rendering
|
4
|
+
------------------------------------------------------------------------------
|
5
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
6
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
7
|
+
-------------------------------------------------------------------
|
8
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_rendering
|
9
|
+
-------------------------------------------------------------------
|
10
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
11
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12
|
+
--------------------------------------------------------------------------
|
13
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
14
|
+
--------------------------------------------------------------------------
|
15
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
16
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12
17
|
---------------------------------------------------------------
|
13
18
|
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
14
19
|
---------------------------------------------------------------
|
15
20
|
[1m[35m (0.1ms)[0m rollback transaction
|
16
|
-
[1m[36m (0.
|
21
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
17
22
|
---------------------------------
|
18
23
|
PolymorphicRenderTest: test_truth
|
19
24
|
---------------------------------
|
20
|
-
[1m[35m (0.
|
25
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
21
26
|
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
27
|
+
------------------------------------------------------------------------------
|
28
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_collection_rendering
|
29
|
+
------------------------------------------------------------------------------
|
30
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
31
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
32
|
+
-------------------------------------------------------------------
|
33
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_rendering
|
34
|
+
-------------------------------------------------------------------
|
35
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
36
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
37
|
+
--------------------------------------------------------------------------
|
38
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
39
|
+
--------------------------------------------------------------------------
|
40
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
41
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22
42
|
---------------------------------------------------------------
|
23
43
|
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
24
44
|
---------------------------------------------------------------
|
25
|
-
[1m[35m (0.
|
26
|
-
[1m[36m (0.
|
45
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
46
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
27
47
|
---------------------------------
|
28
48
|
PolymorphicRenderTest: test_truth
|
29
49
|
---------------------------------
|
30
|
-
[1m[35m (0.
|
31
|
-
[1m[36m (0.
|
32
|
-
|
33
|
-
PolymorphicRender::ApplicationHelperTest:
|
34
|
-
|
35
|
-
[1m[35m (0.
|
36
|
-
[1m[36mSQL (
|
50
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
51
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
52
|
+
------------------------------------------------------------------------------
|
53
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_collection_rendering
|
54
|
+
------------------------------------------------------------------------------
|
55
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
56
|
+
[1m[36mSQL (2.1ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 08:59:22 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 08:59:22 UTC +00:00]]
|
57
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
58
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
59
|
+
[1m[35mSQL (0.8ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 08:59:22 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 08:59:22 UTC +00:00]]
|
60
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
61
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts"
|
62
|
+
Rendered posts/_post_admin.html.erb (0.5ms)
|
63
|
+
Rendered posts/_post_admin.html.erb (0.1ms)
|
64
|
+
[1m[36m (1.5ms)[0m [1mrollback transaction[0m
|
65
|
+
[1m[35m (0.1ms)[0m begin transaction
|
66
|
+
-------------------------------------------------------------------
|
67
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_rendering
|
68
|
+
-------------------------------------------------------------------
|
69
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
70
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00]]
|
71
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
72
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
73
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00]]
|
37
74
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
38
|
-
|
75
|
+
Rendered posts/_post_admin.html.erb (0.1ms)
|
76
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
39
77
|
[1m[35m (0.1ms)[0m begin transaction
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
[1m[36m (0.
|
44
|
-
[1m[
|
45
|
-
|
46
|
-
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
47
|
-
---------------------------------------------------------------
|
78
|
+
--------------------------------------------------------------------------
|
79
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
80
|
+
--------------------------------------------------------------------------
|
81
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
82
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00]]
|
83
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
48
84
|
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
49
|
-
[1m[36mSQL (
|
85
|
+
[1m[36mSQL (1.2ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00]]
|
50
86
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
---------------------------------
|
57
|
-
[1m[36m (1.1ms)[0m [1mrollback transaction[0m
|
58
|
-
[1m[36m (0.6ms)[0m [1mbegin transaction[0m
|
87
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts"[0m
|
88
|
+
Rendered posts/_post.html.erb (0.4ms)
|
89
|
+
Rendered posts/_post.html.erb (0.1ms)
|
90
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
91
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
59
92
|
---------------------------------------------------------------
|
60
93
|
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
61
94
|
---------------------------------------------------------------
|
62
|
-
[1m[35m (0.
|
63
|
-
[1m[36mSQL (
|
64
|
-
[1m[35m (0.
|
65
|
-
|
66
|
-
[1m[
|
67
|
-
[1m[
|
95
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
96
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00]]
|
97
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
98
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
99
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 08:59:23 UTC +00:00]]
|
100
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
101
|
+
Rendered posts/_post.html.erb (0.1ms)
|
102
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
103
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
68
104
|
---------------------------------
|
69
105
|
PolymorphicRenderTest: test_truth
|
70
106
|
---------------------------------
|
71
|
-
[1m[
|
107
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
72
108
|
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
73
|
-
|
74
|
-
PolymorphicRender::ApplicationHelperTest:
|
75
|
-
|
109
|
+
---------------------------------------------------------------------------
|
110
|
+
PolymorphicRender::ApplicationHelperTest: test_complex_namespaced_rendering
|
111
|
+
---------------------------------------------------------------------------
|
112
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
113
|
+
[1m[36mSQL (2.1ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
114
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
115
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
116
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
117
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
118
|
+
Rendered posts/_post_super_admin.html.erb (1.1ms)
|
119
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
120
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
121
|
+
------------------------------------------------------------------------------
|
122
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_collection_rendering
|
123
|
+
------------------------------------------------------------------------------
|
76
124
|
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
77
|
-
[1m[36mSQL (
|
78
|
-
[1m[35m (0.
|
79
|
-
|
80
|
-
[1m[
|
125
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
126
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
127
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
128
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
129
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
130
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts"
|
131
|
+
Rendered posts/_post_admin.html.erb (0.7ms)
|
132
|
+
Rendered posts/_post_admin.html.erb (0.1ms)
|
133
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
81
134
|
[1m[35m (0.1ms)[0m begin transaction
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
[1m[36m (0.
|
86
|
-
[1m[
|
135
|
+
-------------------------------------------------------------------
|
136
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_rendering
|
137
|
+
-------------------------------------------------------------------
|
138
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
139
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
140
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
141
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
142
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
143
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
144
|
+
Rendered posts/_post_admin.html.erb (0.1ms)
|
145
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
146
|
+
[1m[35m (0.0ms)[0m begin transaction
|
87
147
|
--------------------------------------------------------------------------
|
88
148
|
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
89
149
|
--------------------------------------------------------------------------
|
90
|
-
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
91
|
-
[1m[36mSQL (3.0ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00]]
|
92
|
-
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
93
150
|
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
94
|
-
[1m[35mSQL (0.
|
95
|
-
[1m[36m (0.
|
96
|
-
[1m[
|
97
|
-
|
151
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
152
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
153
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
154
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
155
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
156
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts"[0m
|
157
|
+
Rendered posts/_post.html.erb (1.4ms)
|
98
158
|
Rendered posts/_post.html.erb (0.1ms)
|
99
|
-
[1m[
|
100
|
-
[1m[
|
159
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
160
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
101
161
|
---------------------------------------------------------------
|
102
162
|
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
103
163
|
---------------------------------------------------------------
|
104
|
-
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
105
|
-
[1m[35mSQL (0.7ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00]]
|
106
|
-
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
107
164
|
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
108
|
-
[1m[36mSQL (0.
|
165
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
109
166
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
110
|
-
[1m[36m (0.
|
111
|
-
[1m[
|
167
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
168
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:06 UTC +00:00]]
|
169
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
170
|
+
Rendered posts/_post.html.erb (0.1ms)
|
171
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
172
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
112
173
|
---------------------------------
|
113
174
|
PolymorphicRenderTest: test_truth
|
114
175
|
---------------------------------
|
115
|
-
[1m[
|
116
|
-
[1m[36m (0.
|
117
|
-
|
118
|
-
PolymorphicRender::ApplicationHelperTest:
|
119
|
-
|
176
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
177
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
178
|
+
---------------------------------------------------------------------------
|
179
|
+
PolymorphicRender::ApplicationHelperTest: test_complex_namespaced_rendering
|
180
|
+
---------------------------------------------------------------------------
|
181
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
182
|
+
[1m[36mSQL (2.0ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
183
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
184
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
185
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
186
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
187
|
+
[1m[35m (1.1ms)[0m rollback transaction
|
188
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
189
|
+
------------------------------------------------------------------------------
|
190
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_collection_rendering
|
191
|
+
------------------------------------------------------------------------------
|
120
192
|
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
121
|
-
[1m[36mSQL (
|
193
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
122
194
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
123
|
-
[1m[36m (0.
|
124
|
-
[1m[35mSQL (0.5ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at",
|
195
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
196
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
125
197
|
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
126
|
-
[1m[35mPost Load (0.
|
127
|
-
Rendered posts/
|
128
|
-
Rendered posts/
|
129
|
-
[1m[36m (
|
130
|
-
[1m[35m (0.
|
198
|
+
[1m[35mPost Load (0.2ms)[0m SELECT "posts".* FROM "posts"
|
199
|
+
Rendered posts/_post_admin.html.erb (1.1ms)
|
200
|
+
Rendered posts/_post_admin.html.erb (0.1ms)
|
201
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
202
|
+
[1m[35m (0.0ms)[0m begin transaction
|
203
|
+
-------------------------------------------------------------------
|
204
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_rendering
|
205
|
+
-------------------------------------------------------------------
|
206
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
207
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
208
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
209
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
210
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
211
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
212
|
+
Rendered posts/_post_admin.html.erb (0.1ms)
|
213
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
214
|
+
[1m[35m (0.0ms)[0m begin transaction
|
215
|
+
--------------------------------------------------------------------------
|
216
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
217
|
+
--------------------------------------------------------------------------
|
218
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
219
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
220
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
221
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
222
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
223
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
224
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts"[0m
|
225
|
+
Rendered posts/_post.html.erb (0.3ms)
|
226
|
+
Rendered posts/_post.html.erb (0.0ms)
|
227
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
228
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
131
229
|
---------------------------------------------------------------
|
132
230
|
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
133
231
|
---------------------------------------------------------------
|
134
|
-
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
135
|
-
[1m[35mSQL (0.5ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00]]
|
136
|
-
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
137
232
|
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
138
|
-
[1m[36mSQL (0.
|
233
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
139
234
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
235
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
236
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:01:37 UTC +00:00]]
|
237
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
140
238
|
Rendered posts/_post.html.erb (0.1ms)
|
141
|
-
[1m[
|
142
|
-
[1m[
|
239
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
240
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
143
241
|
---------------------------------
|
144
242
|
PolymorphicRenderTest: test_truth
|
145
243
|
---------------------------------
|
146
|
-
[1m[
|
244
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
147
245
|
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
246
|
+
---------------------------------------------------------------------------
|
247
|
+
PolymorphicRender::ApplicationHelperTest: test_complex_namespaced_rendering
|
248
|
+
---------------------------------------------------------------------------
|
249
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
250
|
+
[1m[36mSQL (3.6ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
251
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
252
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
253
|
+
[1m[35mSQL (0.9ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
254
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
255
|
+
Rendered posts/_post_admin.html.erb (1.1ms)
|
256
|
+
Rendered posts/_post_super_admin.html.erb (0.4ms)
|
257
|
+
[1m[35m (0.9ms)[0m rollback transaction
|
258
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
148
259
|
------------------------------------------------------------------------------
|
149
260
|
PolymorphicRender::ApplicationHelperTest: test_namespaced_collection_rendering
|
150
261
|
------------------------------------------------------------------------------
|
151
262
|
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
152
|
-
[1m[36mSQL (
|
263
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
153
264
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
154
265
|
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
155
|
-
[1m[35mSQL (0.
|
266
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
156
267
|
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
157
268
|
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts"
|
158
|
-
Rendered posts/_post_admin.html.erb (0.7ms)
|
159
269
|
Rendered posts/_post_admin.html.erb (0.1ms)
|
160
|
-
|
270
|
+
Rendered posts/_post_admin.html.erb (0.0ms)
|
271
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
161
272
|
[1m[35m (0.1ms)[0m begin transaction
|
162
273
|
-------------------------------------------------------------------
|
163
274
|
PolymorphicRender::ApplicationHelperTest: test_namespaced_rendering
|
164
275
|
-------------------------------------------------------------------
|
165
|
-
[1m[36m (0.
|
166
|
-
[1m[35mSQL (0.
|
167
|
-
[1m[36m (0.
|
276
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
277
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
278
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
168
279
|
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
169
|
-
[1m[36mSQL (0.
|
170
|
-
[1m[35m (0.
|
280
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
281
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
171
282
|
Rendered posts/_post_admin.html.erb (0.1ms)
|
172
|
-
[1m[36m (0.
|
283
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
173
284
|
[1m[35m (0.1ms)[0m begin transaction
|
174
285
|
--------------------------------------------------------------------------
|
175
286
|
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
176
287
|
--------------------------------------------------------------------------
|
177
288
|
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
178
|
-
[1m[35mSQL (0.
|
289
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
179
290
|
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
180
|
-
[1m[35m (0.
|
181
|
-
[1m[36mSQL (0.
|
291
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
292
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
182
293
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
183
294
|
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts"[0m
|
184
|
-
Rendered posts/_post.html.erb (0.
|
185
|
-
Rendered posts/_post.html.erb (0.
|
186
|
-
[1m[35m (0.
|
295
|
+
Rendered posts/_post.html.erb (0.6ms)
|
296
|
+
Rendered posts/_post.html.erb (0.1ms)
|
297
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
187
298
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
188
299
|
---------------------------------------------------------------
|
189
300
|
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
190
301
|
---------------------------------------------------------------
|
191
|
-
[1m[35m (0.
|
192
|
-
[1m[36mSQL (0.
|
302
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
303
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "My First Post"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
193
304
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
194
305
|
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
195
|
-
[1m[35mSQL (0.
|
306
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Fri, 05 Dec 2014 09:03:35 UTC +00:00]]
|
196
307
|
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
197
308
|
Rendered posts/_post.html.erb (0.1ms)
|
198
|
-
[1m[35m (0.
|
199
|
-
[1m[36m (0.
|
309
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
310
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
200
311
|
---------------------------------
|
201
312
|
PolymorphicRenderTest: test_truth
|
202
313
|
---------------------------------
|
203
|
-
[1m[35m (0.
|
314
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
@@ -20,6 +20,11 @@ class PolymorphicRender::ApplicationHelperTest < ActionView::TestCase
|
|
20
20
|
assert_equal "Edit: My First Post\n", polymorphic_render(@post1, :admin)
|
21
21
|
end
|
22
22
|
|
23
|
+
test 'complex namespaced rendering' do
|
24
|
+
assert_equal "Edit: My First Post\n", polymorphic_render(@post1, ['', :admin])
|
25
|
+
assert_equal "Destroy: My First Post\n", polymorphic_render(@post1, [:super, :admin])
|
26
|
+
end
|
27
|
+
|
23
28
|
test 'namespaced collection rendering' do
|
24
29
|
assert_equal "Edit: My First Post\nEdit: I am Blogger!\n", polymorphic_render(Post.all, :admin)
|
25
30
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polymorphic_render
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikhail Dieterle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Extend rails views rendering
|
@@ -45,13 +45,15 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- MIT-LICENSE
|
49
|
+
- README.md
|
50
|
+
- Rakefile
|
48
51
|
- app/helpers/polymorphic_render/application_helper.rb
|
52
|
+
- lib/polymorphic_render.rb
|
49
53
|
- lib/polymorphic_render/engine.rb
|
50
54
|
- lib/polymorphic_render/version.rb
|
51
|
-
-
|
52
|
-
-
|
53
|
-
- Rakefile
|
54
|
-
- README.md
|
55
|
+
- test/dummy/README.rdoc
|
56
|
+
- test/dummy/Rakefile
|
55
57
|
- test/dummy/app/assets/javascripts/application.js
|
56
58
|
- test/dummy/app/assets/stylesheets/application.css
|
57
59
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -60,9 +62,11 @@ files:
|
|
60
62
|
- test/dummy/app/views/layouts/application.html.erb
|
61
63
|
- test/dummy/app/views/posts/_post.html.erb
|
62
64
|
- test/dummy/app/views/posts/_post_admin.html.erb
|
65
|
+
- test/dummy/app/views/posts/_post_super_admin.html.erb
|
63
66
|
- test/dummy/bin/bundle
|
64
67
|
- test/dummy/bin/rails
|
65
68
|
- test/dummy/bin/rake
|
69
|
+
- test/dummy/config.ru
|
66
70
|
- test/dummy/config/application.rb
|
67
71
|
- test/dummy/config/boot.rb
|
68
72
|
- test/dummy/config/database.yml
|
@@ -79,7 +83,6 @@ files:
|
|
79
83
|
- test/dummy/config/initializers/wrap_parameters.rb
|
80
84
|
- test/dummy/config/locales/en.yml
|
81
85
|
- test/dummy/config/routes.rb
|
82
|
-
- test/dummy/config.ru
|
83
86
|
- test/dummy/db/development.sqlite3
|
84
87
|
- test/dummy/db/migrate/20140303085238_create_posts.rb
|
85
88
|
- test/dummy/db/schema.rb
|
@@ -90,8 +93,6 @@ files:
|
|
90
93
|
- test/dummy/public/422.html
|
91
94
|
- test/dummy/public/500.html
|
92
95
|
- test/dummy/public/favicon.ico
|
93
|
-
- test/dummy/Rakefile
|
94
|
-
- test/dummy/README.rdoc
|
95
96
|
- test/dummy/test/fixtures/posts.yml
|
96
97
|
- test/dummy/test/models/post_test.rb
|
97
98
|
- test/helpers/application_helper_test.rb
|
@@ -107,17 +108,17 @@ require_paths:
|
|
107
108
|
- lib
|
108
109
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
110
|
requirements:
|
110
|
-
- -
|
111
|
+
- - ">="
|
111
112
|
- !ruby/object:Gem::Version
|
112
113
|
version: '0'
|
113
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
115
|
requirements:
|
115
|
-
- -
|
116
|
+
- - ">="
|
116
117
|
- !ruby/object:Gem::Version
|
117
118
|
version: '0'
|
118
119
|
requirements: []
|
119
120
|
rubyforge_project:
|
120
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.2.2
|
121
122
|
signing_key:
|
122
123
|
specification_version: 4
|
123
124
|
summary: Extend rails views rendering
|
@@ -130,6 +131,7 @@ test_files:
|
|
130
131
|
- test/dummy/app/views/layouts/application.html.erb
|
131
132
|
- test/dummy/app/views/posts/_post.html.erb
|
132
133
|
- test/dummy/app/views/posts/_post_admin.html.erb
|
134
|
+
- test/dummy/app/views/posts/_post_super_admin.html.erb
|
133
135
|
- test/dummy/bin/bundle
|
134
136
|
- test/dummy/bin/rails
|
135
137
|
- test/dummy/bin/rake
|