publify_core 9.0.0.pre6 → 9.0.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.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -0
  3. data/README.md +9 -0
  4. data/app/controllers/admin/base_controller.rb +0 -6
  5. data/app/controllers/admin/content_controller.rb +34 -15
  6. data/app/controllers/admin/dashboard_controller.rb +4 -9
  7. data/app/controllers/admin/feedback_controller.rb +1 -0
  8. data/app/controllers/admin/notes_controller.rb +1 -1
  9. data/app/controllers/admin/pages_controller.rb +3 -7
  10. data/app/controllers/admin/sidebar_controller.rb +1 -0
  11. data/app/controllers/admin/tags_controller.rb +1 -0
  12. data/app/controllers/articles_controller.rb +50 -55
  13. data/app/controllers/comments_controller.rb +2 -3
  14. data/app/controllers/content_controller.rb +8 -17
  15. data/app/controllers/feedback_controller.rb +5 -39
  16. data/app/controllers/notes_controller.rb +1 -3
  17. data/app/controllers/setup_controller.rb +14 -18
  18. data/app/controllers/tags_controller.rb +13 -15
  19. data/app/controllers/theme_controller.rb +7 -5
  20. data/app/controllers/xml_controller.rb +11 -59
  21. data/app/helpers/authors_helper.rb +2 -2
  22. data/app/helpers/base_helper.rb +11 -4
  23. data/app/helpers/xml_helper.rb +2 -2
  24. data/app/jobs/application_job.rb +2 -0
  25. data/app/models/archives_sidebar.rb +8 -11
  26. data/app/models/article.rb +53 -72
  27. data/app/models/article/factory.rb +1 -1
  28. data/app/models/blog.rb +17 -40
  29. data/app/models/comment.rb +4 -3
  30. data/app/models/content.rb +18 -21
  31. data/app/models/content_base.rb +0 -5
  32. data/app/models/feedback.rb +76 -54
  33. data/app/models/meta_sidebar.rb +1 -0
  34. data/app/models/note.rb +7 -0
  35. data/app/models/page.rb +10 -5
  36. data/app/models/ping.rb +0 -113
  37. data/app/models/post_type.rb +1 -0
  38. data/app/models/redirect.rb +1 -1
  39. data/app/models/resource.rb +1 -19
  40. data/app/models/sidebar.rb +1 -1
  41. data/app/models/static_sidebar.rb +1 -0
  42. data/app/models/tag.rb +13 -9
  43. data/app/models/tag_sidebar.rb +4 -4
  44. data/app/models/trackback.rb +1 -8
  45. data/app/models/trigger.rb +1 -15
  46. data/app/models/user.rb +2 -9
  47. data/app/uploaders/resource_uploader.rb +33 -2
  48. data/app/views/accounts/confirm.html.erb +0 -1
  49. data/app/views/admin/content/_article_list.html.erb +1 -1
  50. data/app/views/admin/content/_form.html.erb +3 -7
  51. data/app/views/admin/pages/_form.html.erb +2 -2
  52. data/app/views/admin/seo/_general.html.erb +33 -28
  53. data/app/views/admin/seo/_permalinks.html.erb +2 -2
  54. data/app/views/admin/seo/_titles.html.erb +36 -36
  55. data/app/views/admin/settings/display.html.erb +20 -27
  56. data/app/views/admin/settings/feedback.html.erb +44 -51
  57. data/app/views/admin/settings/index.html.erb +14 -14
  58. data/app/views/admin/settings/write.html.erb +12 -30
  59. data/app/views/admin/tags/_index_and_form.html.erb +1 -1
  60. data/app/views/articles/_archives_article.html.erb +9 -0
  61. data/app/views/articles/_article.html.erb +8 -6
  62. data/app/views/articles/_article_collection.html.erb +1 -1
  63. data/app/views/articles/_article_excerpt.html.erb +10 -8
  64. data/app/views/articles/_article_links.html.erb +4 -2
  65. data/app/views/articles/_comment_list.html.erb +5 -5
  66. data/app/views/articles/_full_article_content.html.erb +4 -2
  67. data/app/views/articles/archives.html.erb +10 -20
  68. data/app/views/articles/feedback_atom_feed.atom.builder +5 -5
  69. data/app/views/articles/feedback_rss_feed.rss.builder +12 -13
  70. data/app/views/articles/index_atom_feed.atom.builder +3 -4
  71. data/app/views/articles/index_rss_feed.rss.builder +9 -10
  72. data/app/views/articles/read.html.erb +5 -31
  73. data/app/views/articles/search.html.erb +1 -1
  74. data/app/views/articles/trackback.xml.builder +1 -1
  75. data/app/views/authors/show.html.erb +11 -21
  76. data/app/views/authors/show_atom_feed.atom.builder +3 -4
  77. data/app/views/authors/show_rss_feed.rss.builder +9 -10
  78. data/app/views/comments/_comment.html.erb +17 -16
  79. data/app/views/feedback/index.atom.builder +7 -0
  80. data/app/views/feedback/index.rss.builder +19 -0
  81. data/app/views/notes/_note.html.erb +16 -15
  82. data/app/views/notes/index.html.erb +1 -1
  83. data/app/views/notification_mailer/_mail_footer.html.erb +0 -2
  84. data/app/views/notification_mailer/_mail_header.html.erb +2 -0
  85. data/app/views/notification_mailer/article.html.erb +4 -3
  86. data/app/views/notification_mailer/comment.html.erb +7 -6
  87. data/app/views/notification_mailer/notif_user.html.erb +3 -8
  88. data/app/views/setup/index.html.erb +4 -0
  89. data/app/views/shared/_atom_header.atom.builder +3 -3
  90. data/app/views/shared/_atom_item_article.atom.builder +26 -19
  91. data/app/views/shared/_atom_item_comment.atom.builder +3 -5
  92. data/app/views/shared/_atom_item_trackback.atom.builder +3 -4
  93. data/app/views/shared/_page_header.html.erb +1 -1
  94. data/app/views/shared/_rss_item_article.rss.builder +10 -15
  95. data/app/views/shared/_rss_item_comment.rss.builder +1 -2
  96. data/app/views/shared/_rss_item_trackback.rss.builder +1 -1
  97. data/app/views/tags/index.html.erb +2 -2
  98. data/app/views/xml/sitemap.googlesitemap.builder +7 -0
  99. data/config/initializers/mime_types.rb +0 -1
  100. data/config/locales/da.yml +8 -37
  101. data/config/locales/de.yml +7 -36
  102. data/config/locales/en.yml +7 -36
  103. data/config/locales/es-MX.yml +8 -37
  104. data/config/locales/fr.yml +7 -36
  105. data/config/locales/he.yml +4 -33
  106. data/config/locales/it.yml +7 -36
  107. data/config/locales/ja.yml +5 -34
  108. data/config/locales/lt.yml +7 -36
  109. data/config/locales/nb-NO.yml +7 -36
  110. data/config/locales/nl.yml +9 -38
  111. data/config/locales/pl.yml +8 -37
  112. data/config/locales/pt-BR.yml +8 -37
  113. data/config/locales/ro.yml +9 -38
  114. data/config/locales/ru.yml +7 -36
  115. data/config/locales/zh-CN.yml +6 -35
  116. data/config/locales/zh-TW.yml +7 -36
  117. data/config/routes.rb +6 -28
  118. data/db/migrate/113_initial_schema.rb +191 -191
  119. data/db/migrate/114_fixes_buggy_articles_and_notes.rb +6 -7
  120. data/db/migrate/115_drops_categories_for_tags.rb +3 -3
  121. data/db/migrate/20150207131657_add_missing_indexes.rb +1 -1
  122. data/db/migrate/20150807134129_simplify_redirect_relations.rb +1 -1
  123. data/db/migrate/20150808052637_add_blog_ids.rb +3 -5
  124. data/db/migrate/20150808191127_add_blog_id_to_redirects.rb +1 -1
  125. data/db/migrate/20150810094754_add_blog_id_to_tags.rb +1 -1
  126. data/db/migrate/20160108111120_add_devise_to_users.rb +3 -3
  127. data/db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb +1 -1
  128. data/db/migrate/20160110094906_remove_profiles_rights.rb +1 -1
  129. data/db/migrate/20160605103918_replace_profile_id_with_string.rb +1 -3
  130. data/db/migrate/20160605154632_remove_profiles.rb +2 -2
  131. data/db/migrate/20160701061851_demand_blog_id_on_contents.rb +1 -1
  132. data/db/migrate/20160701062604_add_blog_id_to_resources.rb +1 -1
  133. data/db/migrate/20170528093024_move_resources_to_content.rb +5 -0
  134. data/db/migrate/20170528094923_move_tags_to_content.rb +6 -0
  135. data/db/migrate/20170528201606_remove_separate_published_flag.rb +5 -0
  136. data/db/migrate/20170605071626_remove_extra_state_columns_from_feedback.rb +6 -0
  137. data/db/migrate/20170702105201_remove_published_at_from_feedback.rb +5 -0
  138. data/db/seeds.rb +1 -1
  139. data/lib/publify_core.rb +0 -1
  140. data/lib/publify_core/version.rb +1 -1
  141. data/lib/publify_guid.rb +1 -1
  142. data/lib/publify_time.rb +2 -2
  143. data/lib/sidebar_field.rb +19 -12
  144. data/lib/transforms.rb +1 -0
  145. metadata +102 -66
  146. data/.gitignore +0 -13
  147. data/.rspec +0 -2
  148. data/.rubocop.yml +0 -84
  149. data/.rubocop_todo.yml +0 -148
  150. data/.travis.yml +0 -27
  151. data/Gemfile +0 -17
  152. data/README.rdoc +0 -3
  153. data/Rakefile +0 -35
  154. data/app/assets/stylesheets/publify_core/.keep +0 -0
  155. data/app/controllers/.keep +0 -0
  156. data/app/controllers/admin/migrations_controller.rb +0 -19
  157. data/app/controllers/concerns/.keep +0 -0
  158. data/app/controllers/trackbacks_controller.rb +0 -36
  159. data/app/helpers/.keep +0 -0
  160. data/app/mailers/.keep +0 -0
  161. data/app/models/.keep +0 -0
  162. data/app/models/article/states.rb +0 -179
  163. data/app/models/concerns/.keep +0 -0
  164. data/app/models/feedback/states.rb +0 -256
  165. data/app/services/migrator.rb +0 -25
  166. data/app/views/.keep +0 -0
  167. data/app/views/comments/index.html.erb +0 -1
  168. data/app/views/comments/index_atom_feed.atom.builder +0 -8
  169. data/app/views/comments/index_rss_feed.rss.builder +0 -20
  170. data/app/views/trackbacks/index_atom_feed.atom.builder +0 -7
  171. data/app/views/trackbacks/index_rss_feed.rss.builder +0 -20
  172. data/app/views/trackbacks/trackback.xml.builder +0 -4
  173. data/app/views/xml/feed.googlesitemap.builder +0 -7
  174. data/app/views/xml/rsd.rsd.builder +0 -8
  175. data/lib/stateful.rb +0 -106
  176. data/publify_core.gemspec +0 -54
@@ -1,205 +1,205 @@
1
1
  # encoding: UTF-8
2
2
 
3
- class InitialSchema < ActiveRecord::Migration
3
+ class InitialSchema < ActiveRecord::Migration[4.2]
4
4
  def change
5
- create_table "articles_tags", id: false, force: true do |t|
6
- t.integer "article_id"
7
- t.integer "tag_id"
8
- end
9
-
10
- create_table "blogs", force: true do |t|
11
- t.text "settings"
12
- t.string "base_url"
13
- end
14
-
15
- create_table "categories", force: true do |t|
16
- t.string "name"
17
- t.integer "position"
18
- t.string "permalink"
19
- t.text "keywords"
20
- t.text "description"
21
- t.integer "parent_id"
5
+ create_table 'articles_tags', id: false, force: true do |t|
6
+ t.integer 'article_id'
7
+ t.integer 'tag_id'
8
+ end
9
+
10
+ create_table 'blogs', force: true do |t|
11
+ t.text 'settings'
12
+ t.string 'base_url'
13
+ end
14
+
15
+ create_table 'categories', force: true do |t|
16
+ t.string 'name'
17
+ t.integer 'position'
18
+ t.string 'permalink'
19
+ t.text 'keywords'
20
+ t.text 'description'
21
+ t.integer 'parent_id'
22
22
  end
23
23
 
24
- add_index "categories", ["permalink"]
25
-
26
- create_table "categorizations", force: true do |t|
27
- t.integer "article_id"
28
- t.integer "category_id"
29
- t.boolean "is_primary"
24
+ add_index 'categories', ['permalink']
25
+
26
+ create_table 'categorizations', force: true do |t|
27
+ t.integer 'article_id'
28
+ t.integer 'category_id'
29
+ t.boolean 'is_primary'
30
30
  end
31
31
 
32
- create_table "contents", force: true do |t|
33
- t.string "type"
34
- t.string "title"
35
- t.string "author"
36
- t.text "body"
37
- t.text "extended"
38
- t.text "excerpt"
39
- t.datetime "created_at"
40
- t.datetime "updated_at"
41
- t.integer "user_id"
42
- t.string "permalink"
43
- t.string "guid"
44
- t.integer "text_filter_id"
45
- t.text "whiteboard"
46
- t.string "name"
47
- t.boolean "published", default: false
48
- t.boolean "allow_pings"
49
- t.boolean "allow_comments"
50
- t.datetime "published_at"
51
- t.string "state"
52
- t.integer "parent_id"
53
- t.text "settings"
54
- t.string "post_type", default: "read"
55
- end
56
-
57
- add_index "contents", ["published"]
58
- add_index "contents", ["text_filter_id"]
59
-
60
- create_table "feedback", force: true do |t|
61
- t.string "type"
62
- t.string "title"
63
- t.string "author"
64
- t.text "body"
65
- t.text "excerpt"
66
- t.datetime "created_at"
67
- t.datetime "updated_at"
68
- t.integer "user_id"
69
- t.string "guid"
70
- t.integer "text_filter_id"
71
- t.text "whiteboard"
72
- t.integer "article_id"
73
- t.string "email"
74
- t.string "url"
75
- t.string "ip", limit: 40
76
- t.string "blog_name"
77
- t.boolean "published", default: false
78
- t.datetime "published_at"
79
- t.string "state"
80
- t.boolean "status_confirmed"
81
- t.string "user_agent"
82
- end
83
-
84
- add_index "feedback", ["article_id"]
85
- add_index "feedback", ["text_filter_id"]
86
-
87
- create_table "page_caches", force: true do |t|
88
- t.string "name"
89
- end
90
-
91
- add_index "page_caches", ["name"]
92
-
93
- create_table "pings", force: true do |t|
94
- t.integer "article_id"
95
- t.string "url"
96
- t.datetime "created_at"
97
- end
98
-
99
- add_index "pings", ["article_id"]
100
-
101
- create_table "post_types", force: true do |t|
102
- t.string "name"
103
- t.string "permalink"
104
- t.string "description"
105
- end
106
-
107
- create_table "profiles", force: true do |t|
108
- t.string "label"
109
- t.string "nicename"
110
- t.text "modules"
111
- end
112
-
113
- create_table "profiles_rights", id: false, force: true do |t|
114
- t.integer "profile_id"
115
- t.integer "right_id"
116
- end
117
-
118
- create_table "redirections", force: true do |t|
119
- t.integer "content_id"
120
- t.integer "redirect_id"
121
- end
122
-
123
- create_table "redirects", force: true do |t|
124
- t.string "from_path"
125
- t.string "to_path"
126
- t.string "origin"
127
- t.datetime "created_at"
128
- t.datetime "updated_at"
129
- end
130
-
131
- create_table "resources", force: true do |t|
132
- t.integer "size"
133
- t.string "upload"
134
- t.string "mime"
135
- t.datetime "created_at"
136
- t.datetime "updated_at"
137
- t.integer "article_id"
138
- t.boolean "itunes_metadata"
139
- t.string "itunes_author"
140
- t.string "itunes_subtitle"
141
- t.integer "itunes_duration"
142
- t.text "itunes_summary"
143
- t.string "itunes_keywords"
144
- t.string "itunes_category"
145
- t.boolean "itunes_explicit"
146
- end
147
-
148
- create_table "sidebars", force: true do |t|
149
- t.integer "active_position"
150
- t.text "config"
151
- t.integer "staged_position"
152
- t.string "type"
153
- end
154
-
155
- create_table "sitealizer", force: true do |t|
156
- t.string "path"
157
- t.string "ip"
158
- t.string "referer"
159
- t.string "language"
160
- t.string "user_agent"
161
- t.datetime "created_at"
162
- t.date "created_on"
163
- end
164
-
165
- create_table "tags", force: true do |t|
166
- t.string "name"
167
- t.datetime "created_at"
168
- t.datetime "updated_at"
169
- t.string "display_name"
170
- end
171
-
172
- create_table "text_filters", force: true do |t|
173
- t.string "name"
174
- t.string "description"
175
- t.string "markup"
176
- t.text "filters"
177
- t.text "params"
32
+ create_table 'contents', force: true do |t|
33
+ t.string 'type'
34
+ t.string 'title'
35
+ t.string 'author'
36
+ t.text 'body'
37
+ t.text 'extended'
38
+ t.text 'excerpt'
39
+ t.datetime 'created_at'
40
+ t.datetime 'updated_at'
41
+ t.integer 'user_id'
42
+ t.string 'permalink'
43
+ t.string 'guid'
44
+ t.integer 'text_filter_id'
45
+ t.text 'whiteboard'
46
+ t.string 'name'
47
+ t.boolean 'published', default: false
48
+ t.boolean 'allow_pings'
49
+ t.boolean 'allow_comments'
50
+ t.datetime 'published_at'
51
+ t.string 'state'
52
+ t.integer 'parent_id'
53
+ t.text 'settings'
54
+ t.string 'post_type', default: 'read'
55
+ end
56
+
57
+ add_index 'contents', ['published']
58
+ add_index 'contents', ['text_filter_id']
59
+
60
+ create_table 'feedback', force: true do |t|
61
+ t.string 'type'
62
+ t.string 'title'
63
+ t.string 'author'
64
+ t.text 'body'
65
+ t.text 'excerpt'
66
+ t.datetime 'created_at'
67
+ t.datetime 'updated_at'
68
+ t.integer 'user_id'
69
+ t.string 'guid'
70
+ t.integer 'text_filter_id'
71
+ t.text 'whiteboard'
72
+ t.integer 'article_id'
73
+ t.string 'email'
74
+ t.string 'url'
75
+ t.string 'ip', limit: 40
76
+ t.string 'blog_name'
77
+ t.boolean 'published', default: false
78
+ t.datetime 'published_at'
79
+ t.string 'state'
80
+ t.boolean 'status_confirmed'
81
+ t.string 'user_agent'
82
+ end
83
+
84
+ add_index 'feedback', ['article_id']
85
+ add_index 'feedback', ['text_filter_id']
86
+
87
+ create_table 'page_caches', force: true do |t|
88
+ t.string 'name'
89
+ end
90
+
91
+ add_index 'page_caches', ['name']
92
+
93
+ create_table 'pings', force: true do |t|
94
+ t.integer 'article_id'
95
+ t.string 'url'
96
+ t.datetime 'created_at'
97
+ end
98
+
99
+ add_index 'pings', ['article_id']
100
+
101
+ create_table 'post_types', force: true do |t|
102
+ t.string 'name'
103
+ t.string 'permalink'
104
+ t.string 'description'
105
+ end
106
+
107
+ create_table 'profiles', force: true do |t|
108
+ t.string 'label'
109
+ t.string 'nicename'
110
+ t.text 'modules'
111
+ end
112
+
113
+ create_table 'profiles_rights', id: false, force: true do |t|
114
+ t.integer 'profile_id'
115
+ t.integer 'right_id'
116
+ end
117
+
118
+ create_table 'redirections', force: true do |t|
119
+ t.integer 'content_id'
120
+ t.integer 'redirect_id'
121
+ end
122
+
123
+ create_table 'redirects', force: true do |t|
124
+ t.string 'from_path'
125
+ t.string 'to_path'
126
+ t.string 'origin'
127
+ t.datetime 'created_at'
128
+ t.datetime 'updated_at'
129
+ end
130
+
131
+ create_table 'resources', force: true do |t|
132
+ t.integer 'size'
133
+ t.string 'upload'
134
+ t.string 'mime'
135
+ t.datetime 'created_at'
136
+ t.datetime 'updated_at'
137
+ t.integer 'article_id'
138
+ t.boolean 'itunes_metadata'
139
+ t.string 'itunes_author'
140
+ t.string 'itunes_subtitle'
141
+ t.integer 'itunes_duration'
142
+ t.text 'itunes_summary'
143
+ t.string 'itunes_keywords'
144
+ t.string 'itunes_category'
145
+ t.boolean 'itunes_explicit'
146
+ end
147
+
148
+ create_table 'sidebars', force: true do |t|
149
+ t.integer 'active_position'
150
+ t.text 'config'
151
+ t.integer 'staged_position'
152
+ t.string 'type'
153
+ end
154
+
155
+ create_table 'sitealizer', force: true do |t|
156
+ t.string 'path'
157
+ t.string 'ip'
158
+ t.string 'referer'
159
+ t.string 'language'
160
+ t.string 'user_agent'
161
+ t.datetime 'created_at'
162
+ t.date 'created_on'
163
+ end
164
+
165
+ create_table 'tags', force: true do |t|
166
+ t.string 'name'
167
+ t.datetime 'created_at'
168
+ t.datetime 'updated_at'
169
+ t.string 'display_name'
170
+ end
171
+
172
+ create_table 'text_filters', force: true do |t|
173
+ t.string 'name'
174
+ t.string 'description'
175
+ t.string 'markup'
176
+ t.text 'filters'
177
+ t.text 'params'
178
178
  end
179
179
 
180
- create_table "triggers", force: true do |t|
181
- t.integer "pending_item_id"
182
- t.string "pending_item_type"
183
- t.datetime "due_at"
184
- t.string "trigger_method"
180
+ create_table 'triggers', force: true do |t|
181
+ t.integer 'pending_item_id'
182
+ t.string 'pending_item_type'
183
+ t.datetime 'due_at'
184
+ t.string 'trigger_method'
185
185
  end
186
186
 
187
- create_table "users", force: true do |t|
188
- t.string "login"
189
- t.string "password"
190
- t.text "email"
191
- t.text "name"
192
- t.boolean "notify_via_email"
193
- t.boolean "notify_on_new_articles"
194
- t.boolean "notify_on_comments"
195
- t.integer "profile_id"
196
- t.string "remember_token"
197
- t.datetime "remember_token_expires_at"
198
- t.string "text_filter_id", default: "1"
199
- t.string "state", default: "active"
200
- t.datetime "last_connection"
201
- t.text "settings"
202
- t.integer "resource_id"
187
+ create_table 'users', force: true do |t|
188
+ t.string 'login'
189
+ t.string 'password'
190
+ t.text 'email'
191
+ t.text 'name'
192
+ t.boolean 'notify_via_email'
193
+ t.boolean 'notify_on_new_articles'
194
+ t.boolean 'notify_on_comments'
195
+ t.integer 'profile_id'
196
+ t.string 'remember_token'
197
+ t.datetime 'remember_token_expires_at'
198
+ t.string 'text_filter_id', default: '1'
199
+ t.string 'state', default: 'active'
200
+ t.datetime 'last_connection'
201
+ t.text 'settings'
202
+ t.integer 'resource_id'
203
203
  end
204
204
  end
205
205
  end
@@ -1,6 +1,5 @@
1
- class FixesBuggyArticlesAndNotes < ActiveRecord::Migration
1
+ class FixesBuggyArticlesAndNotes < ActiveRecord::Migration[4.2]
2
2
  class Content < ActiveRecord::Base
3
-
4
3
  end
5
4
 
6
5
  class Article < Content
@@ -30,16 +29,16 @@ class FixesBuggyArticlesAndNotes < ActiveRecord::Migration
30
29
  end
31
30
 
32
31
  def self.up
33
- say "Fixing contents permalinks, this may take some time"
32
+ say 'Fixing contents permalinks, this may take some time'
34
33
 
35
- contents = Content.where("permalink is ? or permalink = ?", nil, '')
34
+ contents = Content.where('permalink is ? or permalink = ?', nil, '')
36
35
  contents.each do |c|
37
36
  c.set_permalink
38
37
  c.save
39
38
  end
40
39
 
41
- say "Fixes empty notes GUID"
42
- notes = Note.where("guid is ? or guid = ?", nil, '')
40
+ say 'Fixes empty notes GUID'
41
+ notes = Note.where('guid is ? or guid = ?', nil, '')
43
42
  notes.each do |n|
44
43
  n.create_guid
45
44
  n.save
@@ -47,6 +46,6 @@ class FixesBuggyArticlesAndNotes < ActiveRecord::Migration
47
46
  end
48
47
 
49
48
  def self.down
50
- say "Nothing to do here"
49
+ say 'Nothing to do here'
51
50
  end
52
51
  end
@@ -1,4 +1,4 @@
1
- class DropsCategoriesForTags < ActiveRecord::Migration
1
+ class DropsCategoriesForTags < ActiveRecord::Migration[4.2]
2
2
  class Categorization < ActiveRecord::Base
3
3
  belongs_to :article
4
4
  belongs_to :category
@@ -6,7 +6,7 @@ class DropsCategoriesForTags < ActiveRecord::Migration
6
6
 
7
7
  class Category < ActiveRecord::Base
8
8
  has_many :categorizations
9
- has_many :articles, :through => :categorizations
9
+ has_many :articles, through: :categorizations
10
10
  end
11
11
 
12
12
  def up
@@ -18,7 +18,7 @@ class DropsCategoriesForTags < ActiveRecord::Migration
18
18
  end
19
19
 
20
20
  redirect = Redirect.create(from_path: "category/#{cat.permalink}",
21
- to_path: File.join(Blog.first.base_url, "tag", tag.name))
21
+ to_path: File.join(Blog.first.base_url, 'tag', tag.name))
22
22
  cat.articles.each do |article|
23
23
  article.tags << tag
24
24
  article.save