storytime 2.1.6 → 2.1.7

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.
Files changed (236) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +54 -0
  3. data/.gitignore +2 -1
  4. data/.ruby-version +1 -1
  5. data/.tool-versions +1 -0
  6. data/Gemfile +5 -3
  7. data/Gemfile.lock +414 -425
  8. data/Guardfile +1 -1
  9. data/app/assets/fonts/storytime-icons.eot +0 -0
  10. data/app/assets/fonts/storytime-icons.svg +23 -0
  11. data/app/assets/fonts/storytime-icons.ttf +0 -0
  12. data/app/assets/fonts/storytime-icons.woff +0 -0
  13. data/app/assets/javascripts/storytime/application.js +1 -8
  14. data/app/assets/javascripts/storytime/off_canvas.coffee +16 -0
  15. data/app/assets/javascripts/storytime/wysiwyg.js.coffee +9 -7
  16. data/app/assets/stylesheets/storytime/_buttons.scss +33 -0
  17. data/app/assets/stylesheets/storytime/_list-group.scss +1 -1
  18. data/app/assets/stylesheets/storytime/application.scss +14 -2
  19. data/app/assets/stylesheets/storytime/icons.scss +5 -5
  20. data/app/assets/stylesheets/storytime/leather/_buttons.scss +31 -0
  21. data/app/assets/stylesheets/storytime/leather/_devise.scss +72 -0
  22. data/app/assets/stylesheets/storytime/leather/_grid.scss +19 -0
  23. data/app/assets/stylesheets/storytime/leather/_list_groups.scss +33 -0
  24. data/app/assets/stylesheets/storytime/leather/_nav_menus.scss +125 -0
  25. data/app/assets/stylesheets/storytime/leather/_navbar_transparent.scss +23 -0
  26. data/app/assets/stylesheets/storytime/leather/_off_canvas.scss +109 -0
  27. data/app/assets/stylesheets/storytime/leather/_scroll_panels.scss +85 -0
  28. data/app/assets/stylesheets/storytime/leather/_toggle_columns.scss +23 -0
  29. data/app/assets/stylesheets/storytime/leather/_typography.scss +12 -0
  30. data/app/assets/stylesheets/storytime/leather/_utilities.scss +54 -0
  31. data/app/assets/stylesheets/storytime/leather/_variables.scss +8 -0
  32. data/app/assets/stylesheets/storytime/posts.scss +9 -1
  33. data/app/controllers/storytime/application_controller.rb +1 -1
  34. data/app/controllers/storytime/dashboard/blog_posts_controller.rb +5 -3
  35. data/app/controllers/storytime/dashboard/blogs_controller.rb +1 -1
  36. data/app/controllers/storytime/dashboard/media_controller.rb +4 -4
  37. data/app/controllers/storytime/dashboard/memberships_controller.rb +1 -1
  38. data/app/controllers/storytime/dashboard/pages_controller.rb +26 -6
  39. data/app/controllers/storytime/dashboard/posts_controller.rb +30 -5
  40. data/app/controllers/storytime/dashboard/subscriptions_controller.rb +1 -1
  41. data/app/controllers/storytime/pages_controller.rb +31 -1
  42. data/app/controllers/storytime/posts_controller.rb +1 -1
  43. data/app/controllers/storytime/subscriptions_controller.rb +5 -1
  44. data/app/helpers/storytime/application_helper.rb +0 -4
  45. data/app/models/concerns/storytime/post_featured_images.rb +2 -2
  46. data/app/models/concerns/storytime/post_partial_inheritance.rb +2 -2
  47. data/app/models/storytime/autosave.rb +1 -1
  48. data/app/models/storytime/comment.rb +1 -1
  49. data/app/models/storytime/media.rb +1 -1
  50. data/app/models/storytime/membership.rb +2 -2
  51. data/app/models/storytime/post.rb +7 -3
  52. data/app/models/storytime/site.rb +4 -6
  53. data/app/models/storytime/snippet.rb +12 -1
  54. data/app/models/storytime/subscription.rb +2 -2
  55. data/app/models/storytime/version.rb +1 -1
  56. data/app/policies/storytime/post_policy.rb +1 -1
  57. data/app/views/storytime/dashboard/_navigation.html.erb +0 -9
  58. data/app/views/storytime/dashboard/blog_posts/_form.html.erb +5 -1
  59. data/app/views/storytime/dashboard/blogs/edit.json.jbuilder +1 -1
  60. data/app/views/storytime/dashboard/blogs/index.json.jbuilder +1 -1
  61. data/app/views/storytime/dashboard/blogs/new.json.jbuilder +1 -1
  62. data/app/views/storytime/dashboard/media/_gallery.html.erb +1 -1
  63. data/app/views/storytime/dashboard/media/_modal.html.erb +2 -2
  64. data/app/views/storytime/dashboard/media/show.json.jbuilder +1 -1
  65. data/app/views/storytime/dashboard/memberships/_edit.html.erb +1 -1
  66. data/app/views/storytime/dashboard/memberships/_index.html.erb +3 -3
  67. data/app/views/storytime/dashboard/memberships/_new.html.erb +1 -1
  68. data/app/views/storytime/dashboard/memberships/edit.json.jbuilder +1 -1
  69. data/app/views/storytime/dashboard/memberships/index.json.jbuilder +1 -1
  70. data/app/views/storytime/dashboard/memberships/new.json.jbuilder +1 -1
  71. data/app/views/storytime/dashboard/memberships/save.json.jbuilder +1 -1
  72. data/app/views/storytime/dashboard/pages/_form.html.erb +1 -1
  73. data/app/views/storytime/dashboard/posts/_directory.html.erb +18 -0
  74. data/app/views/storytime/dashboard/posts/_form.html.erb +1 -1
  75. data/app/views/storytime/dashboard/posts/_list.html.erb +2 -26
  76. data/app/views/storytime/dashboard/posts/_new_button.html.erb +1 -1
  77. data/app/views/storytime/dashboard/posts/_post.html.erb +28 -0
  78. data/app/views/storytime/dashboard/posts/_sorts.html.erb +21 -0
  79. data/app/views/storytime/dashboard/posts/index.html.erb +5 -3
  80. data/app/views/storytime/dashboard/roles/_form.html.erb +1 -1
  81. data/app/views/storytime/dashboard/roles/edit.json.jbuilder +1 -1
  82. data/app/views/storytime/dashboard/sites/_form.html.erb +1 -1
  83. data/app/views/storytime/dashboard/sites/site.json.jbuilder +1 -1
  84. data/app/views/storytime/dashboard/snippets/_index.html.erb +1 -1
  85. data/app/views/storytime/dashboard/snippets/edit.json.jbuilder +1 -1
  86. data/app/views/storytime/dashboard/snippets/index.json.jbuilder +1 -1
  87. data/app/views/storytime/dashboard/snippets/new.json.jbuilder +1 -1
  88. data/app/views/storytime/dashboard/subscriptions/_form.html.erb +1 -1
  89. data/app/views/storytime/dashboard/subscriptions/_index.html.erb +2 -2
  90. data/app/views/storytime/dashboard/subscriptions/form.json.jbuilder +1 -1
  91. data/app/views/storytime/dashboard/subscriptions/index.json.jbuilder +1 -1
  92. data/app/views/storytime/dashboard/versions/_versions_info.html.erb +1 -1
  93. data/app/views/storytime/posts/show.html.erb +6 -0
  94. data/app/views/storytime/sites/_google_analytics_code.html.erb +5 -8
  95. data/config/initializers/assets.rb +2 -1
  96. data/config/initializers/friendly_id.rb +1 -1
  97. data/config/initializers/url_for_patch.rb +19 -8
  98. data/config/locales/devise.zh-CN.yml +59 -0
  99. data/config/locales/kaminari.zh-CN.yml +17 -0
  100. data/config/locales/simple_form.zh-CN.yml +26 -0
  101. data/config/locales/zh-CN.yml +141 -0
  102. data/config/routes.rb +2 -4
  103. data/db/migrate/20140501174341_create_storytime_posts.rb +1 -1
  104. data/db/migrate/20140509191309_create_friendly_id_slugs.rb +1 -1
  105. data/db/migrate/20140511200849_create_storytime_media.rb +1 -1
  106. data/db/migrate/20140513161233_create_storytime_sites.rb +1 -1
  107. data/db/migrate/20140514200234_create_storytime_tags.rb +1 -1
  108. data/db/migrate/20140514200304_create_storytime_taggings.rb +1 -1
  109. data/db/migrate/20140516141252_create_storytime_versions.rb +1 -1
  110. data/db/migrate/20140521190606_create_storytime_roles.rb +1 -1
  111. data/db/migrate/20140521191048_add_storytime_role_id_to_users.rb +1 -1
  112. data/db/migrate/20140521191728_create_storytime_permissions.rb +1 -1
  113. data/db/migrate/20140521191744_create_storytime_actions.rb +1 -1
  114. data/db/migrate/20140813014447_create_storytime_comments.rb +1 -1
  115. data/db/migrate/20140813130534_add_storytime_name_to_users.rb +1 -1
  116. data/db/migrate/20140916183056_create_storytime_autosaves.rb +1 -1
  117. data/db/migrate/20141020213343_add_secondary_media_id_to_storytime_post.rb +1 -1
  118. data/db/migrate/20141021073356_create_storytime_snippets.rb +1 -1
  119. data/db/migrate/20141111164439_create_storytime_subscriptions.rb +1 -1
  120. data/db/migrate/20150122200805_add_title_and_content_index_to_storytime_post.rb +1 -1
  121. data/db/migrate/20150128185746_seed_new_actions_and_permissions.rb +1 -1
  122. data/db/migrate/20150129215308_add_site_id_to_storytime_subscription.rb +1 -1
  123. data/db/migrate/20150206201847_add_site_id_to_storytime_post.rb +1 -1
  124. data/db/migrate/20150206201919_add_site_id_to_storytime_snippet.rb +1 -1
  125. data/db/migrate/20150206201931_add_site_id_to_storytime_tag.rb +1 -1
  126. data/db/migrate/20150206205256_add_notification_fields_to_storytime_post.rb +1 -1
  127. data/db/migrate/20150216211257_add_subdomain_to_storytime_sites.rb +1 -1
  128. data/db/migrate/20150216225045_add_site_to_storytime_media.rb +1 -1
  129. data/db/migrate/20150219210528_remove_root_page_content_from_storytime_sites.rb +1 -1
  130. data/db/migrate/20150220184902_add_blog_id_to_posts.rb +1 -1
  131. data/db/migrate/20150224192138_add_homepage_path_to_storytime_sites.rb +1 -1
  132. data/db/migrate/20150224193151_add_subscription_email_from_to_storytime_sites.rb +1 -1
  133. data/db/migrate/20150224193551_add_layout_to_storytime_sites.rb +1 -1
  134. data/db/migrate/20150224194559_add_disqus_forum_shortname_to_storytime_sites.rb +1 -1
  135. data/db/migrate/20150224212453_remove_homepage_path_from_storytime_sites.rb +1 -1
  136. data/db/migrate/20150225143516_add_site_id_to_storytime_autosaves.rb +1 -1
  137. data/db/migrate/20150225143826_add_site_id_to_storytime_comments.rb +1 -1
  138. data/db/migrate/20150225145119_add_site_id_to_storytime_versions.rb +1 -1
  139. data/db/migrate/20150225145316_add_site_id_to_storytime_taggings.rb +1 -1
  140. data/db/migrate/20150225145608_update_storytime_site_id_columns.rb +1 -1
  141. data/db/migrate/20150225164232_add_site_id_to_storytime_permissions.rb +1 -1
  142. data/db/migrate/20150225212917_create_storytime_memberships.rb +1 -1
  143. data/db/migrate/20150225213535_create_memberships_for_storytime_users.rb +1 -1
  144. data/db/migrate/20150226201739_add_custom_domain_to_storytime_sites.rb +1 -1
  145. data/db/migrate/20150302171500_add_site_id_to_storytime_media.rb +1 -1
  146. data/db/migrate/20150302171722_set_site_layout.rb +1 -1
  147. data/db/migrate/20150302185138_remove_storytime_role_id_from_users.rb +1 -1
  148. data/db/migrate/20150302192525_transfer_posts_to_blogs.rb +1 -1
  149. data/db/migrate/20150302192759_seed_permissions.rb +1 -1
  150. data/db/migrate/20150331162329_add_discourse_name_to_storytime_sites.rb +1 -1
  151. data/db/migrate/20150402161427_remove_subdomain_from_storytime_site.rb +1 -1
  152. data/db/migrate/20150520181115_create_storytime_navigations.rb +1 -1
  153. data/db/migrate/20150520185227_create_storytime_links.rb +1 -1
  154. data/db/migrate/20150520190700_add_position_to_storytime_links.rb +1 -1
  155. data/db/migrate/20150529192058_add_url_to_storytime_links.rb +1 -1
  156. data/db/migrate/20260408001637_add_canonical_url_to_storytime_posts.rb +5 -0
  157. data/db/migrate/20260701000000_sanitize_existing_storytime_snippets.rb +22 -0
  158. data/lib/storytime/cli/install.rb +2 -20
  159. data/lib/storytime/concerns/action_controller_extension.rb +36 -0
  160. data/lib/storytime/constraints/page_constraint.rb +8 -2
  161. data/lib/storytime/engine.rb +3 -5
  162. data/lib/storytime/migrators/v1.rb +3 -3
  163. data/lib/storytime/post_notifier.rb +1 -1
  164. data/lib/storytime/post_url_handler.rb +18 -5
  165. data/lib/storytime/storytime_helpers.rb +4 -0
  166. data/lib/storytime/version.rb +1 -1
  167. data/lib/storytime.rb +1 -1
  168. data/spec/controllers/dashboard_controller_spec.rb +5 -6
  169. data/spec/dummy/app/assets/config/manifest.js +3 -0
  170. data/spec/dummy/config/database.yml +3 -3
  171. data/spec/dummy/config/initializers/devise.rb +1 -1
  172. data/spec/dummy/db/migrate/20140530185250_devise_create_users.rb +1 -1
  173. data/spec/dummy/db/migrate/20150127172846_create_widgets.rb +1 -1
  174. data/spec/dummy/db/migrate/20150206203824_add_video_url_to_storytime_posts.rb +1 -1
  175. data/spec/dummy/db/schema.rb +226 -244
  176. data/spec/factories/action_factories.rb +3 -3
  177. data/spec/factories/comment_factories.rb +1 -1
  178. data/spec/factories/media_factories.rb +1 -1
  179. data/spec/factories/membership_factories.rb +1 -1
  180. data/spec/factories/navigation_factories.rb +3 -3
  181. data/spec/factories/permission_factories.rb +1 -1
  182. data/spec/factories/post_factories.rb +2 -2
  183. data/spec/factories/role_factories.rb +11 -11
  184. data/spec/factories/site_factories.rb +3 -3
  185. data/spec/factories/snippet_factories.rb +1 -1
  186. data/spec/factories/subscription_factories.rb +1 -1
  187. data/spec/factories/user_factories.rb +2 -2
  188. data/spec/factories/widget_factories.rb +2 -2
  189. data/spec/features/blogs_spec.rb +7 -7
  190. data/spec/features/comments_spec.rb +11 -11
  191. data/spec/features/dashboard/media_spec.rb +17 -11
  192. data/spec/features/dashboard/memberships_spec.rb +13 -19
  193. data/spec/features/dashboard/navigations_spec.rb +1 -1
  194. data/spec/features/dashboard/pages_spec.rb +8 -8
  195. data/spec/features/dashboard/posts_spec.rb +19 -19
  196. data/spec/features/dashboard/sites_spec.rb +1 -1
  197. data/spec/features/dashboard/snippets_spec.rb +3 -3
  198. data/spec/features/dashboard/subscription_spec.rb +2 -2
  199. data/spec/features/pages_spec.rb +3 -3
  200. data/spec/features/posts_spec.rb +2 -2
  201. data/spec/features/subscription_spec.rb +3 -3
  202. data/spec/importers/wordpress_spec.rb +1 -1
  203. data/spec/lib/mysql_fulltext_search_adapter_spec.rb +3 -3
  204. data/spec/lib/mysql_search_adapter_spec.rb +3 -3
  205. data/spec/lib/postgres_search_adapter_spec.rb +3 -3
  206. data/spec/lib/sqlite3_search_adapter_spec.rb +3 -3
  207. data/spec/lib/storytime/constraints/page_constraint_spec.rb +40 -0
  208. data/spec/lib/storytime_helpers_spec.rb +2 -2
  209. data/spec/models/navigation_spec.rb +3 -3
  210. data/spec/models/post_spec.rb +29 -29
  211. data/spec/models/snippet_spec.rb +31 -0
  212. data/spec/models/subscription_spec.rb +4 -4
  213. data/spec/models/tagging_spec.rb +14 -14
  214. data/spec/models/version_spec.rb +29 -29
  215. data/spec/policies/comment_policy_spec.rb +11 -11
  216. data/spec/policies/post_policy_spec.rb +13 -13
  217. data/spec/requests/pages_spec.rb +37 -0
  218. data/spec/requests/routings_spec.rb +14 -15
  219. data/spec/spec_helper.rb +8 -15
  220. data/spec/support/domains.rb +2 -2
  221. data/spec/support/feature_macros.rb +5 -5
  222. data/spec/support/pundit_matcher.rb +3 -3
  223. data/storytime.gemspec +15 -20
  224. data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +195 -0
  225. data/vendor/assets/javascripts/codemirror/addons/edit/closetag.js +169 -0
  226. data/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js +182 -0
  227. data/vendor/assets/javascripts/codemirror.js +8922 -0
  228. data/vendor/assets/javascripts/medium-editor.min.js +3 -3
  229. data/vendor/assets/stylesheets/codemirror/themes/solarized.css +169 -0
  230. data/vendor/assets/stylesheets/codemirror.css +347 -0
  231. metadata +94 -134
  232. data/config/initializers/storytime_admin.rb +0 -5
  233. data/config/spring.rb +0 -1
  234. data/spec/dummy/app/controllers/storytime_admin/widgets_controller.rb +0 -5
  235. data/spec/dummy/db/development.sqlite3 +0 -0
  236. data/spec/dummy/db/test.sqlite3 +0 -0
@@ -1,255 +1,237 @@
1
- # encoding: UTF-8
2
1
  # This file is auto-generated from the current state of the database. Instead
3
2
  # of editing this file, please use the migrations feature of Active Record to
4
3
  # incrementally modify your database, and then regenerate this schema definition.
5
4
  #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
11
10
  #
12
11
  # It's strongly recommended that you check this file into your version control system.
13
12
 
14
- ActiveRecord::Schema.define(version: 20150529192058) do
15
-
13
+ ActiveRecord::Schema[8.1].define(version: 2026_07_01_000000) do
16
14
  # These are extensions that must be enabled in order to support this database
17
- enable_extension "plpgsql"
18
-
19
- create_table "friendly_id_slugs", force: :cascade do |t|
20
- t.string "slug", null: false
21
- t.integer "sluggable_id", null: false
22
- t.string "sluggable_type", limit: 50
23
- t.string "scope"
24
- t.datetime "created_at"
25
- end
26
-
27
- add_index "friendly_id_slugs", ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true, using: :btree
28
- add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", using: :btree
29
- add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id", using: :btree
30
- add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree
31
-
32
- create_table "storytime_actions", force: :cascade do |t|
33
- t.string "name"
34
- t.string "guid"
35
- t.datetime "created_at"
36
- t.datetime "updated_at"
37
- end
38
-
39
- add_index "storytime_actions", ["guid"], name: "index_storytime_actions_on_guid", using: :btree
40
-
41
- create_table "storytime_autosaves", force: :cascade do |t|
42
- t.text "content"
43
- t.integer "autosavable_id"
44
- t.string "autosavable_type"
45
- t.datetime "created_at"
46
- t.datetime "updated_at"
47
- t.integer "site_id"
48
- end
49
-
50
- add_index "storytime_autosaves", ["autosavable_type", "autosavable_id"], name: "autosavable_index", using: :btree
51
- add_index "storytime_autosaves", ["site_id"], name: "index_storytime_autosaves_on_site_id", using: :btree
52
-
53
- create_table "storytime_comments", force: :cascade do |t|
54
- t.text "content"
55
- t.integer "user_id"
56
- t.integer "post_id"
57
- t.datetime "created_at"
58
- t.datetime "updated_at"
59
- t.integer "site_id"
60
- end
61
-
62
- add_index "storytime_comments", ["post_id"], name: "index_storytime_comments_on_post_id", using: :btree
63
- add_index "storytime_comments", ["site_id"], name: "index_storytime_comments_on_site_id", using: :btree
64
- add_index "storytime_comments", ["user_id"], name: "index_storytime_comments_on_user_id", using: :btree
65
-
66
- create_table "storytime_links", force: :cascade do |t|
67
- t.string "text"
68
- t.integer "storytime_navigation_id"
69
- t.integer "linkable_id"
70
- t.string "linkable_type"
71
- t.datetime "created_at", null: false
72
- t.datetime "updated_at", null: false
73
- t.integer "position"
74
- t.string "url"
75
- end
76
-
77
- add_index "storytime_links", ["linkable_type", "linkable_id"], name: "index_storytime_links_on_linkable_type_and_linkable_id", using: :btree
78
- add_index "storytime_links", ["position"], name: "index_storytime_links_on_position", using: :btree
79
- add_index "storytime_links", ["storytime_navigation_id"], name: "index_storytime_links_on_storytime_navigation_id", using: :btree
80
-
81
- create_table "storytime_media", force: :cascade do |t|
82
- t.string "file"
83
- t.integer "user_id"
84
- t.datetime "created_at"
85
- t.datetime "updated_at"
86
- t.integer "site_id"
87
- end
88
-
89
- add_index "storytime_media", ["site_id"], name: "index_storytime_media_on_site_id", using: :btree
90
- add_index "storytime_media", ["user_id"], name: "index_storytime_media_on_user_id", using: :btree
91
-
92
- create_table "storytime_memberships", force: :cascade do |t|
93
- t.integer "user_id"
94
- t.integer "storytime_role_id"
95
- t.integer "site_id"
96
- t.datetime "created_at"
97
- t.datetime "updated_at"
98
- end
99
-
100
- add_index "storytime_memberships", ["site_id"], name: "index_storytime_memberships_on_site_id", using: :btree
101
- add_index "storytime_memberships", ["storytime_role_id"], name: "index_storytime_memberships_on_storytime_role_id", using: :btree
102
- add_index "storytime_memberships", ["user_id"], name: "index_storytime_memberships_on_user_id", using: :btree
103
-
104
- create_table "storytime_navigations", force: :cascade do |t|
105
- t.string "name"
106
- t.string "handle"
107
- t.integer "site_id"
108
- t.datetime "created_at", null: false
109
- t.datetime "updated_at", null: false
110
- end
111
-
112
- add_index "storytime_navigations", ["site_id"], name: "index_storytime_navigations_on_site_id", using: :btree
113
-
114
- create_table "storytime_permissions", force: :cascade do |t|
115
- t.integer "role_id"
116
- t.integer "action_id"
117
- t.datetime "created_at"
118
- t.datetime "updated_at"
119
- t.integer "site_id"
120
- end
121
-
122
- add_index "storytime_permissions", ["action_id"], name: "index_storytime_permissions_on_action_id", using: :btree
123
- add_index "storytime_permissions", ["role_id"], name: "index_storytime_permissions_on_role_id", using: :btree
124
- add_index "storytime_permissions", ["site_id"], name: "index_storytime_permissions_on_site_id", using: :btree
125
-
126
- create_table "storytime_posts", force: :cascade do |t|
127
- t.integer "user_id"
128
- t.string "type"
129
- t.string "title"
130
- t.string "slug"
131
- t.text "content"
132
- t.text "excerpt"
133
- t.datetime "published_at"
134
- t.integer "featured_media_id"
135
- t.boolean "featured", default: false
136
- t.datetime "created_at"
137
- t.datetime "updated_at"
138
- t.string "video_url"
139
- t.integer "secondary_media_id"
140
- t.integer "site_id"
141
- t.boolean "notifications_enabled", default: false
142
- t.datetime "notifications_sent_at"
143
- t.integer "blog_id"
144
- end
145
-
146
- add_index "storytime_posts", ["blog_id"], name: "index_storytime_posts_on_blog_id", using: :btree
147
- add_index "storytime_posts", ["slug"], name: "index_storytime_posts_on_slug", using: :btree
148
- add_index "storytime_posts", ["user_id"], name: "index_storytime_posts_on_user_id", using: :btree
149
-
150
- create_table "storytime_roles", force: :cascade do |t|
151
- t.string "name"
152
- t.datetime "created_at"
153
- t.datetime "updated_at"
154
- end
155
-
156
- add_index "storytime_roles", ["name"], name: "index_storytime_roles_on_name", using: :btree
157
-
158
- create_table "storytime_sites", force: :cascade do |t|
159
- t.string "title"
160
- t.integer "post_slug_style", default: 0
161
- t.string "ga_tracking_id"
162
- t.integer "root_post_id"
163
- t.datetime "created_at"
164
- t.datetime "updated_at"
165
- t.string "subscription_email_from"
166
- t.string "layout"
167
- t.string "disqus_forum_shortname"
168
- t.integer "user_id"
169
- t.string "custom_domain"
170
- t.string "discourse_name"
171
- end
172
-
173
- add_index "storytime_sites", ["root_post_id"], name: "index_storytime_sites_on_root_post_id", using: :btree
174
- add_index "storytime_sites", ["user_id"], name: "index_storytime_sites_on_user_id", using: :btree
175
-
176
- create_table "storytime_snippets", force: :cascade do |t|
177
- t.string "name"
178
- t.text "content"
179
- t.datetime "created_at"
180
- t.datetime "updated_at"
181
- t.integer "site_id"
182
- end
183
-
184
- add_index "storytime_snippets", ["name"], name: "index_storytime_snippets_on_name", using: :btree
185
-
186
- create_table "storytime_subscriptions", force: :cascade do |t|
187
- t.string "email"
188
- t.boolean "subscribed", default: true
189
- t.string "token"
190
- t.datetime "created_at"
191
- t.datetime "updated_at"
192
- t.integer "site_id"
193
- end
194
-
195
- add_index "storytime_subscriptions", ["token"], name: "index_storytime_subscriptions_on_token", using: :btree
196
-
197
- create_table "storytime_taggings", force: :cascade do |t|
198
- t.integer "tag_id"
199
- t.integer "post_id"
200
- t.datetime "created_at"
201
- t.datetime "updated_at"
202
- t.integer "site_id"
203
- end
204
-
205
- add_index "storytime_taggings", ["post_id"], name: "index_storytime_taggings_on_post_id", using: :btree
206
- add_index "storytime_taggings", ["site_id"], name: "index_storytime_taggings_on_site_id", using: :btree
207
- add_index "storytime_taggings", ["tag_id"], name: "index_storytime_taggings_on_tag_id", using: :btree
208
-
209
- create_table "storytime_tags", force: :cascade do |t|
210
- t.string "name"
211
- t.datetime "created_at"
212
- t.datetime "updated_at"
213
- t.integer "site_id"
214
- end
215
-
216
- create_table "storytime_versions", force: :cascade do |t|
217
- t.text "content"
218
- t.integer "user_id"
219
- t.integer "versionable_id"
220
- t.string "versionable_type"
221
- t.datetime "created_at"
222
- t.datetime "updated_at"
223
- t.integer "site_id"
224
- end
225
-
226
- add_index "storytime_versions", ["site_id"], name: "index_storytime_versions_on_site_id", using: :btree
227
- add_index "storytime_versions", ["user_id"], name: "index_storytime_versions_on_user_id", using: :btree
228
- add_index "storytime_versions", ["versionable_type", "versionable_id"], name: "versionable_index", using: :btree
229
-
230
- create_table "users", force: :cascade do |t|
231
- t.string "email", default: "", null: false
232
- t.string "encrypted_password", default: "", null: false
233
- t.string "reset_password_token"
234
- t.datetime "reset_password_sent_at"
235
- t.datetime "remember_created_at"
236
- t.integer "sign_in_count", default: 0, null: false
237
- t.datetime "current_sign_in_at"
238
- t.datetime "last_sign_in_at"
239
- t.string "current_sign_in_ip"
240
- t.string "last_sign_in_ip"
241
- t.datetime "created_at"
242
- t.datetime "updated_at"
243
- t.string "storytime_name"
244
- end
245
-
246
- add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
247
- add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
248
-
249
- create_table "widgets", force: :cascade do |t|
250
- t.string "name"
251
- t.datetime "created_at"
252
- t.datetime "updated_at"
15
+ enable_extension "pg_catalog.plpgsql"
16
+
17
+ create_table "friendly_id_slugs", id: :serial, force: :cascade do |t|
18
+ t.datetime "created_at", precision: nil
19
+ t.string "scope"
20
+ t.string "slug", null: false
21
+ t.integer "sluggable_id", null: false
22
+ t.string "sluggable_type", limit: 50
23
+ t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
24
+ t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
25
+ t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
26
+ t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
27
+ end
28
+
29
+ create_table "storytime_actions", id: :serial, force: :cascade do |t|
30
+ t.datetime "created_at", precision: nil
31
+ t.string "guid"
32
+ t.string "name"
33
+ t.datetime "updated_at", precision: nil
34
+ t.index ["guid"], name: "index_storytime_actions_on_guid"
35
+ end
36
+
37
+ create_table "storytime_autosaves", id: :serial, force: :cascade do |t|
38
+ t.integer "autosavable_id"
39
+ t.string "autosavable_type"
40
+ t.text "content"
41
+ t.datetime "created_at", precision: nil
42
+ t.integer "site_id"
43
+ t.datetime "updated_at", precision: nil
44
+ t.index ["autosavable_type", "autosavable_id"], name: "autosavable_index"
45
+ t.index ["site_id"], name: "index_storytime_autosaves_on_site_id"
46
+ end
47
+
48
+ create_table "storytime_comments", id: :serial, force: :cascade do |t|
49
+ t.text "content"
50
+ t.datetime "created_at", precision: nil
51
+ t.integer "post_id"
52
+ t.integer "site_id"
53
+ t.datetime "updated_at", precision: nil
54
+ t.integer "user_id"
55
+ t.index ["post_id"], name: "index_storytime_comments_on_post_id"
56
+ t.index ["site_id"], name: "index_storytime_comments_on_site_id"
57
+ t.index ["user_id"], name: "index_storytime_comments_on_user_id"
58
+ end
59
+
60
+ create_table "storytime_links", id: :serial, force: :cascade do |t|
61
+ t.datetime "created_at", precision: nil, null: false
62
+ t.integer "linkable_id"
63
+ t.string "linkable_type"
64
+ t.integer "position"
65
+ t.integer "storytime_navigation_id"
66
+ t.string "text"
67
+ t.datetime "updated_at", precision: nil, null: false
68
+ t.string "url"
69
+ t.index ["linkable_type", "linkable_id"], name: "index_storytime_links_on_linkable_type_and_linkable_id"
70
+ t.index ["position"], name: "index_storytime_links_on_position"
71
+ t.index ["storytime_navigation_id"], name: "index_storytime_links_on_storytime_navigation_id"
72
+ end
73
+
74
+ create_table "storytime_media", id: :serial, force: :cascade do |t|
75
+ t.datetime "created_at", precision: nil
76
+ t.string "file"
77
+ t.integer "site_id"
78
+ t.datetime "updated_at", precision: nil
79
+ t.integer "user_id"
80
+ t.index ["site_id"], name: "index_storytime_media_on_site_id"
81
+ t.index ["user_id"], name: "index_storytime_media_on_user_id"
82
+ end
83
+
84
+ create_table "storytime_memberships", id: :serial, force: :cascade do |t|
85
+ t.datetime "created_at", precision: nil
86
+ t.integer "site_id"
87
+ t.integer "storytime_role_id"
88
+ t.datetime "updated_at", precision: nil
89
+ t.integer "user_id"
90
+ t.index ["site_id"], name: "index_storytime_memberships_on_site_id"
91
+ t.index ["storytime_role_id"], name: "index_storytime_memberships_on_storytime_role_id"
92
+ t.index ["user_id"], name: "index_storytime_memberships_on_user_id"
93
+ end
94
+
95
+ create_table "storytime_navigations", id: :serial, force: :cascade do |t|
96
+ t.datetime "created_at", precision: nil, null: false
97
+ t.string "handle"
98
+ t.string "name"
99
+ t.integer "site_id"
100
+ t.datetime "updated_at", precision: nil, null: false
101
+ t.index ["site_id"], name: "index_storytime_navigations_on_site_id"
102
+ end
103
+
104
+ create_table "storytime_permissions", id: :serial, force: :cascade do |t|
105
+ t.integer "action_id"
106
+ t.datetime "created_at", precision: nil
107
+ t.integer "role_id"
108
+ t.integer "site_id"
109
+ t.datetime "updated_at", precision: nil
110
+ t.index ["action_id"], name: "index_storytime_permissions_on_action_id"
111
+ t.index ["role_id"], name: "index_storytime_permissions_on_role_id"
112
+ t.index ["site_id"], name: "index_storytime_permissions_on_site_id"
113
+ end
114
+
115
+ create_table "storytime_posts", id: :serial, force: :cascade do |t|
116
+ t.integer "blog_id"
117
+ t.string "canonical_url"
118
+ t.text "content"
119
+ t.datetime "created_at", precision: nil
120
+ t.text "excerpt"
121
+ t.boolean "featured", default: false
122
+ t.integer "featured_media_id"
123
+ t.boolean "notifications_enabled", default: false
124
+ t.datetime "notifications_sent_at", precision: nil
125
+ t.datetime "published_at", precision: nil
126
+ t.integer "secondary_media_id"
127
+ t.integer "site_id"
128
+ t.string "slug"
129
+ t.string "title"
130
+ t.string "type"
131
+ t.datetime "updated_at", precision: nil
132
+ t.integer "user_id"
133
+ t.string "video_url"
134
+ t.index ["blog_id"], name: "index_storytime_posts_on_blog_id"
135
+ t.index ["slug"], name: "index_storytime_posts_on_slug"
136
+ t.index ["user_id"], name: "index_storytime_posts_on_user_id"
137
+ end
138
+
139
+ create_table "storytime_roles", id: :serial, force: :cascade do |t|
140
+ t.datetime "created_at", precision: nil
141
+ t.string "name"
142
+ t.datetime "updated_at", precision: nil
143
+ t.index ["name"], name: "index_storytime_roles_on_name"
144
+ end
145
+
146
+ create_table "storytime_sites", id: :serial, force: :cascade do |t|
147
+ t.datetime "created_at", precision: nil
148
+ t.string "custom_domain"
149
+ t.string "discourse_name"
150
+ t.string "disqus_forum_shortname"
151
+ t.string "ga_tracking_id"
152
+ t.string "layout"
153
+ t.integer "post_slug_style", default: 0
154
+ t.integer "root_post_id"
155
+ t.string "subscription_email_from"
156
+ t.string "title"
157
+ t.datetime "updated_at", precision: nil
158
+ t.integer "user_id"
159
+ t.index ["root_post_id"], name: "index_storytime_sites_on_root_post_id"
160
+ t.index ["user_id"], name: "index_storytime_sites_on_user_id"
161
+ end
162
+
163
+ create_table "storytime_snippets", id: :serial, force: :cascade do |t|
164
+ t.text "content"
165
+ t.datetime "created_at", precision: nil
166
+ t.string "name"
167
+ t.integer "site_id"
168
+ t.datetime "updated_at", precision: nil
169
+ t.index ["name"], name: "index_storytime_snippets_on_name"
170
+ end
171
+
172
+ create_table "storytime_subscriptions", id: :serial, force: :cascade do |t|
173
+ t.datetime "created_at", precision: nil
174
+ t.string "email"
175
+ t.integer "site_id"
176
+ t.boolean "subscribed", default: true
177
+ t.string "token"
178
+ t.datetime "updated_at", precision: nil
179
+ t.index ["token"], name: "index_storytime_subscriptions_on_token"
180
+ end
181
+
182
+ create_table "storytime_taggings", id: :serial, force: :cascade do |t|
183
+ t.datetime "created_at", precision: nil
184
+ t.integer "post_id"
185
+ t.integer "site_id"
186
+ t.integer "tag_id"
187
+ t.datetime "updated_at", precision: nil
188
+ t.index ["post_id"], name: "index_storytime_taggings_on_post_id"
189
+ t.index ["site_id"], name: "index_storytime_taggings_on_site_id"
190
+ t.index ["tag_id"], name: "index_storytime_taggings_on_tag_id"
191
+ end
192
+
193
+ create_table "storytime_tags", id: :serial, force: :cascade do |t|
194
+ t.datetime "created_at", precision: nil
195
+ t.string "name"
196
+ t.integer "site_id"
197
+ t.datetime "updated_at", precision: nil
198
+ end
199
+
200
+ create_table "storytime_versions", id: :serial, force: :cascade do |t|
201
+ t.text "content"
202
+ t.datetime "created_at", precision: nil
203
+ t.integer "site_id"
204
+ t.datetime "updated_at", precision: nil
205
+ t.integer "user_id"
206
+ t.integer "versionable_id"
207
+ t.string "versionable_type"
208
+ t.index ["site_id"], name: "index_storytime_versions_on_site_id"
209
+ t.index ["user_id"], name: "index_storytime_versions_on_user_id"
210
+ t.index ["versionable_type", "versionable_id"], name: "versionable_index"
211
+ end
212
+
213
+ create_table "users", id: :serial, force: :cascade do |t|
214
+ t.datetime "created_at", precision: nil
215
+ t.datetime "current_sign_in_at", precision: nil
216
+ t.string "current_sign_in_ip"
217
+ t.string "email", default: "", null: false
218
+ t.string "encrypted_password", default: "", null: false
219
+ t.datetime "last_sign_in_at", precision: nil
220
+ t.string "last_sign_in_ip"
221
+ t.datetime "remember_created_at", precision: nil
222
+ t.datetime "reset_password_sent_at", precision: nil
223
+ t.string "reset_password_token"
224
+ t.integer "sign_in_count", default: 0, null: false
225
+ t.string "storytime_name"
226
+ t.datetime "updated_at", precision: nil
227
+ t.index ["email"], name: "index_users_on_email", unique: true
228
+ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
229
+ end
230
+
231
+ create_table "widgets", id: :serial, force: :cascade do |t|
232
+ t.datetime "created_at", precision: nil
233
+ t.string "name"
234
+ t.datetime "updated_at", precision: nil
253
235
  end
254
236
 
255
237
  add_foreign_key "storytime_links", "storytime_navigations"
@@ -1,5 +1,5 @@
1
- FactoryGirl.define do
2
- factory :action, class: Storytime::Action do
3
- name 'Manage Users'
1
+ FactoryBot.define do
2
+ factory :action, class: "Storytime::Action" do
3
+ name { 'Manage Users' }
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :comment, class: Storytime::Comment do
3
3
  user
4
4
  post
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :media, class: Storytime::Media do
3
3
  user
4
4
  file { Rack::Test::UploadedFile.new(File.open('./spec/support/images/success-kid.jpg'), 'image/jpg') }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :membership, class: Storytime::Membership do
3
3
  association :user, factory: :user
4
4
  association :site, factory: :site
@@ -1,6 +1,6 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :navigation, class: Storytime::Navigation do
3
- name "Main Navigation"
4
- handle "main-navigation"
3
+ name { "Main Navigation" }
4
+ handle { "main-navigation" }
5
5
  end
6
6
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :permission, class: Storytime::Permission do
3
3
  role
4
4
  action
@@ -1,11 +1,11 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :post, class: Storytime::BlogPost do
3
3
  user
4
4
  sequence(:title) { |i| "Post ##{i}" }
5
5
  sequence(:draft_content) { |i| "Post ##{i}. It was a dark and stormy night. The End." }
6
6
  sequence(:content) { |i| "Post ##{i}. It was a dark and stormy night. The End." }
7
7
  sequence(:excerpt) { |i| "Post ##{i}. It was a dark and stormy night." }
8
- tag_list [""]
8
+ tag_list { [""] }
9
9
  published_at { Time.now }
10
10
 
11
11
  factory :page, class: Storytime::Page do
@@ -1,36 +1,36 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :role, class: Storytime::Role do
3
- name 'writer'
3
+ name { 'writer' }
4
4
 
5
5
  factory :writer_role, class: Storytime::Role do
6
- name 'writer'
6
+ name { 'writer' }
7
7
 
8
8
  after(:create) do |role, evaluator|
9
9
  ["Publish Own Posts/Pages"].each do |name|
10
- action = FactoryGirl.create(:action, name: name)
11
- FactoryGirl.create(:permission, role: role, action: action)
10
+ action = FactoryBot.create(:action, name: name)
11
+ FactoryBot.create(:permission, role: role, action: action)
12
12
  end
13
13
  end
14
14
  end
15
15
 
16
16
  factory :editor_role, class: Storytime::Role do
17
- name 'editor'
17
+ name { 'editor' }
18
18
 
19
19
  after(:create) do |role, evaluator|
20
20
  ["Publish Own Posts/Pages", "Manage Others' Posts/Pages"].each do |name|
21
- action = FactoryGirl.create(:action, name: name)
22
- FactoryGirl.create(:permission, role: role, action: action)
21
+ action = FactoryBot.create(:action, name: name)
22
+ FactoryBot.create(:permission, role: role, action: action)
23
23
  end
24
24
  end
25
25
  end
26
26
 
27
27
  factory :admin_role, class: Storytime::Role do
28
- name 'admin'
28
+ name { 'admin' }
29
29
 
30
30
  after(:create) do |role, evaluator|
31
31
  ["Publish Own Posts/Pages", "Manage Others' Posts/Pages", "Manage Site Settings", "Manage Users"].each do |name|
32
- action = FactoryGirl.create(:action, name: name)
33
- FactoryGirl.create(:permission, role: role, action: action)
32
+ action = FactoryBot.create(:action, name: name)
33
+ FactoryBot.create(:permission, role: role, action: action)
34
34
  end
35
35
  end
36
36
  end
@@ -1,8 +1,8 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :site, class: Storytime::Site do
3
3
  sequence(:title) {|i| "Site Title #{i}"}
4
- subscription_email_from "notifications@site.com"
4
+ subscription_email_from { "notifications@site.com" }
5
5
  sequence(:custom_domain){|i| "site-#{i}.lvh.me" }
6
- post_slug_style 0
6
+ post_slug_style { 0 }
7
7
  end
8
8
  end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :snippet, class: Storytime::Snippet do
3
3
  sequence(:name) { |i| "snippet-#{i}" }
4
4
  sequence(:content) { |i| "Snippet ##{i}. Fortune favors the bold." }
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :subscription, class: Storytime::Subscription do
3
3
  sequence(:email) { |n| "test_user_#{n}@example.com" }
4
4
  end