refinerycms-whatson 1.8.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 (137) hide show
  1. data/.gitignore +48 -0
  2. data/.tork.rb +2 -0
  3. data/.travis.yml +2 -0
  4. data/Gemfile +7 -0
  5. data/Rakefile +3 -0
  6. data/app/controllers/admin/whatson/categories_controller.rb +11 -0
  7. data/app/controllers/admin/whatson/comments_controller.rb +40 -0
  8. data/app/controllers/admin/whatson/posts_controller.rb +97 -0
  9. data/app/controllers/admin/whatson/settings_controller.rb +53 -0
  10. data/app/controllers/whatson/categories_controller.rb +13 -0
  11. data/app/controllers/whatson/posts_controller.rb +109 -0
  12. data/app/controllers/whatson_controller.rb +16 -0
  13. data/app/helpers/whatson_posts_helper.rb +56 -0
  14. data/app/mailers/whatson/comment_mailer.rb +13 -0
  15. data/app/models/categorization.rb +7 -0
  16. data/app/models/whatson/comment_mailer.rb +1 -0
  17. data/app/models/whatson_category.rb +19 -0
  18. data/app/models/whatson_comment.rb +137 -0
  19. data/app/models/whatson_post.rb +114 -0
  20. data/app/views/admin/whatson/_submenu.html.erb +96 -0
  21. data/app/views/admin/whatson/categories/_category.html.erb +16 -0
  22. data/app/views/admin/whatson/categories/_form.html.erb +19 -0
  23. data/app/views/admin/whatson/categories/_sortable_list.html.erb +7 -0
  24. data/app/views/admin/whatson/categories/edit.html.erb +1 -0
  25. data/app/views/admin/whatson/categories/index.html.erb +26 -0
  26. data/app/views/admin/whatson/categories/new.html.erb +1 -0
  27. data/app/views/admin/whatson/comments/_comment.html.erb +20 -0
  28. data/app/views/admin/whatson/comments/_sortable_list.html.erb +7 -0
  29. data/app/views/admin/whatson/comments/index.html.erb +35 -0
  30. data/app/views/admin/whatson/comments/show.html.erb +63 -0
  31. data/app/views/admin/whatson/posts/_form.css.erb +20 -0
  32. data/app/views/admin/whatson/posts/_form.html.erb +110 -0
  33. data/app/views/admin/whatson/posts/_form.js.erb +23 -0
  34. data/app/views/admin/whatson/posts/_form_part.html.erb +3 -0
  35. data/app/views/admin/whatson/posts/_post.html.erb +24 -0
  36. data/app/views/admin/whatson/posts/_sortable_list.html.erb +7 -0
  37. data/app/views/admin/whatson/posts/_teaser_part.html.erb +11 -0
  38. data/app/views/admin/whatson/posts/edit.html.erb +1 -0
  39. data/app/views/admin/whatson/posts/index.html.erb +28 -0
  40. data/app/views/admin/whatson/posts/new.html.erb +1 -0
  41. data/app/views/admin/whatson/posts/uncategorized.html.erb +26 -0
  42. data/app/views/admin/whatson/settings/notification_recipients.html.erb +24 -0
  43. data/app/views/shared/admin/_autocomplete.html.erb +55 -0
  44. data/app/views/whatson/categories/show.html.erb +21 -0
  45. data/app/views/whatson/comment_mailer/notification.html.erb +17 -0
  46. data/app/views/whatson/posts/_comment.html.erb +10 -0
  47. data/app/views/whatson/posts/_nav.html.erb +11 -0
  48. data/app/views/whatson/posts/archive.html.erb +20 -0
  49. data/app/views/whatson/posts/index.html.erb +24 -0
  50. data/app/views/whatson/posts/index.rss.builder +17 -0
  51. data/app/views/whatson/posts/show.html.erb +98 -0
  52. data/app/views/whatson/posts/tagged.html.erb +22 -0
  53. data/app/views/whatson/shared/_archive_list.html.erb +9 -0
  54. data/app/views/whatson/shared/_categories.html.erb +10 -0
  55. data/app/views/whatson/shared/_post.html.erb +46 -0
  56. data/app/views/whatson/shared/_related_posts.html.erb +10 -0
  57. data/app/views/whatson/shared/_rss_feed.html.erb +2 -0
  58. data/app/views/whatson/shared/_tags.html.erb +8 -0
  59. data/config/locales/bg.yml +158 -0
  60. data/config/locales/cs.yml +128 -0
  61. data/config/locales/de.yml +130 -0
  62. data/config/locales/en.yml +159 -0
  63. data/config/locales/es.yml +159 -0
  64. data/config/locales/fr.yml +154 -0
  65. data/config/locales/it.yml +156 -0
  66. data/config/locales/ja.yml +159 -0
  67. data/config/locales/nb.yml +30 -0
  68. data/config/locales/nl.yml +134 -0
  69. data/config/locales/pl.yml +134 -0
  70. data/config/locales/pt-BR.yml +143 -0
  71. data/config/locales/ru.yml +135 -0
  72. data/config/locales/sk.yml +128 -0
  73. data/config/locales/zh-CN.yml +128 -0
  74. data/config/routes.rb +47 -0
  75. data/db/migrate/1_create_whatson_structure.rb +54 -0
  76. data/db/migrate/2_add_user_id_to_whatson_posts.rb +11 -0
  77. data/db/migrate/3_acts_as_taggable_on_migration.rb +28 -0
  78. data/db/migrate/4_create_seo_meta_for_whatson.rb +25 -0
  79. data/db/migrate/5_add_cached_slugs.rb +11 -0
  80. data/db/migrate/6_add_custom_url_field_to_whatson_posts.rb +9 -0
  81. data/db/migrate/7_add_custom_teaser_field_to_whatson_posts.rb +10 -0
  82. data/db/migrate/8_add_primary_key_to_categorizations.rb +12 -0
  83. data/db/seeds/refinerycms_whatson.rb +20 -0
  84. data/features/authors.feature +15 -0
  85. data/features/category.feature +23 -0
  86. data/features/support/factories/whatson_categories.rb +5 -0
  87. data/features/support/factories/whatson_comments.rb +8 -0
  88. data/features/support/factories/whatson_posts.rb +9 -0
  89. data/features/support/paths.rb +24 -0
  90. data/features/support/step_definitions/authors_steps.rb +7 -0
  91. data/features/support/step_definitions/category_steps.rb +11 -0
  92. data/features/support/step_definitions/tags_steps.rb +13 -0
  93. data/features/tags.feature +26 -0
  94. data/lib/gemspec.rb +37 -0
  95. data/lib/generators/refinerycms_whatson_generator.rb +8 -0
  96. data/lib/refinery/whatson/tabs.rb +28 -0
  97. data/lib/refinery/whatson/version.rb +17 -0
  98. data/lib/refinerycms-whatson.rb +41 -0
  99. data/public/images/refinerycms-whatson/icons/cog.png +0 -0
  100. data/public/images/refinerycms-whatson/icons/comment.png +0 -0
  101. data/public/images/refinerycms-whatson/icons/comment_cross.png +0 -0
  102. data/public/images/refinerycms-whatson/icons/comment_tick.png +0 -0
  103. data/public/images/refinerycms-whatson/icons/comments.png +0 -0
  104. data/public/images/refinerycms-whatson/icons/down.gif +0 -0
  105. data/public/images/refinerycms-whatson/icons/folder.png +0 -0
  106. data/public/images/refinerycms-whatson/icons/folder_add.png +0 -0
  107. data/public/images/refinerycms-whatson/icons/folder_edit.png +0 -0
  108. data/public/images/refinerycms-whatson/icons/page.png +0 -0
  109. data/public/images/refinerycms-whatson/icons/page_add.png +0 -0
  110. data/public/images/refinerycms-whatson/icons/page_copy.png +0 -0
  111. data/public/images/refinerycms-whatson/icons/up.gif +0 -0
  112. data/public/images/refinerycms-whatson/rss-feed.png +0 -0
  113. data/public/javascripts/refinery/refinerycms-whatson.js +50 -0
  114. data/public/javascripts/refinerycms-whatson.js +25 -0
  115. data/public/stylesheets/refinery/refinerycms-whatson.css +57 -0
  116. data/public/stylesheets/refinerycms-whatson.css +93 -0
  117. data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  118. data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  119. data/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  120. data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  121. data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  122. data/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  123. data/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  124. data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  125. data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  126. data/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  127. data/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  128. data/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  129. data/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  130. data/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  131. data/public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css +330 -0
  132. data/readme.md +41 -0
  133. data/refinerycms-whatson.gemspec +18 -0
  134. data/spec/models/whatson_category_spec.rb +41 -0
  135. data/spec/models/whatson_comment_spec.rb +21 -0
  136. data/spec/models/whatson_post_spec.rb +217 -0
  137. metadata +235 -0
@@ -0,0 +1,128 @@
1
+ sk:
2
+ plugins:
3
+ refinerycms_whatson:
4
+ title: Whatson
5
+ admin:
6
+ whatson:
7
+ categories:
8
+ category:
9
+ edit: Upraviť kategóriu
10
+ delete: Zmazať kategóriu
11
+ index:
12
+ no_items_yet: 'Nie sú tu žiadne kategórie. Klikni "%{create}" pre pridanie prvej.'
13
+ comments:
14
+ approved: 'Komentár od "%{author}" bol schválený.'
15
+ comment:
16
+ view_live_html: 'Zobraziť živý náhľad <br/><em>(otvorí nové okno)</em>'
17
+ read: Zobraziť komentár
18
+ reject: Zamietnuť komentár
19
+ approve: Schváliť
20
+ rejected: 'Komentár od "%{author}" bol zamietnutý.'
21
+ index:
22
+ no_items_yet: 'Nie sú tu žiadne %{type} komentáre.'
23
+ show:
24
+ comment: Komentár
25
+ whatson_post: Whatson článok
26
+ from: Odoslal
27
+ date: Dátum
28
+ message: Správa
29
+ details: Detaily
30
+ age: Vek
31
+ actions: Akcie
32
+ back: Späť na zoznam komentárov.
33
+ reject: Zamietnuť komentár
34
+ approve: Schváliť komentár
35
+ posts:
36
+ form:
37
+ advanced_options: Pokročilé nastavenia
38
+ toggle_advanced_options: Klikni pre prístup k nastaveniam meta tagov a menu
39
+ save_as_draft: Uložiť ako koncept
40
+ published_at: Dátum publikovania
41
+ index:
42
+ no_items_yet: 'Nie sú žiadne články na whatsonu. Klikni na "%{create}" pre pridanie prvého.'
43
+ uncategorized:
44
+ no_items_yet: 'Nie sú žiadne nekategorizované články.'
45
+ post:
46
+ view_live_html: 'Zobraziť článok<br/><em>(otvorí ho v novom okne)</em>'
47
+ edit: Upraviť článok
48
+ delete: Zmazať článok
49
+ settings:
50
+ notification_recipients:
51
+ value: Poslať notifikáciu pre
52
+ explanation: 'Vždy keď niekto pridá komentár, Refinery pošle notifikáciu.'
53
+ hint: 'Vždy keď niekto pridá komentár, Refinery ti pošle notifikáciu.'
54
+ example: "Zadaj tvoju emailovú adresu(y) ako napríklad: jack@work.com, jill@office.com"
55
+ updated: 'Zoznam príjemcov notifikácií "%{recipients}"'
56
+ submenu:
57
+ categories:
58
+ title: Kategórie
59
+ manage: Spravovať
60
+ new: Nová kategória
61
+ comments:
62
+ title: Komentáre
63
+ title_with_count: 'Komentáre (%{new_count} nových)'
64
+ new: Nový
65
+ unmoderated: Nový
66
+ approved: Schválený
67
+ rejected: Zamietnutý
68
+ posts:
69
+ title: Články
70
+ manage: Spravovať články
71
+ new: Vytvoriť nový článok
72
+ uncategorized: Nekategorizované články
73
+ settings:
74
+ title: Nastavenia
75
+ moderation: Moderovanie
76
+ update_notified: Upraviť zoznam notifikovaných
77
+ comments: Komentáre
78
+ whatson:
79
+ comment_mailer:
80
+ notification:
81
+ greeting: Ahoj
82
+ you_recieved_new_comment: Máš nový komentár na stránke
83
+ comment_starts: --- začiatok komentára ---
84
+ comment_ends: --- koniec komentára ---
85
+ from: Od
86
+ email: Email
87
+ message: Správa
88
+ closing_line: S pozdravom
89
+ ps: 'P.S. Všetky komentáre su uložené v sekcii "Whatson" pod záložkou "Komentáre" v prípade ak by ich bolo potrebné zobraziť neskôr.'
90
+ shared:
91
+ categories:
92
+ title: Kategórie
93
+ rss_feed:
94
+ title: RSS zdroj článkov
95
+ subscribe: Prihlásiť k odberu
96
+ posts:
97
+ other: Ďaľšie články
98
+ created_at: 'Publikovaný %{when}'
99
+ read_more: Celý článok
100
+ comments:
101
+ singular: komentár
102
+ none: Nie sú tu žiadne komentáre
103
+ archives: Archív
104
+ categories:
105
+ show:
106
+ no_posts: Nie sú tu žiadne články momentálne.
107
+ posts:
108
+ post:
109
+ filed_in: Podaný
110
+ comment: komentár
111
+ comments:
112
+ by: 'Odoslal %{who}'
113
+ time_ago: '%{time} späť'
114
+ thank_you: 'Vďaka za komentár.'
115
+ thank_you_moderated: 'Ďakujeme za Váš komentár. Vaša správa čaká na schválenie a objaví sa v najbližšej dobe.'
116
+ index:
117
+ no_whatson_articles_yet: Práve Nie sú žiadne články na whatsonu. Zostante naladení.
118
+ show:
119
+ whatson_home: Hlavná stránka whatsonu
120
+ comments:
121
+ title: Komentáre
122
+ add: Pridať komentár
123
+ other: Ďalšie články
124
+ filed_in: Podaný
125
+ submit: Odoslať komentár
126
+ archive:
127
+ whatson_archive_for: 'Whatson archív pre %{date}'
128
+ no_whatson_articles_posted: 'Nie sú žiadne články publikované %{date}.'
@@ -0,0 +1,128 @@
1
+ zh-CN:
2
+ plugins:
3
+ refinerycms_whatson:
4
+ title: 博客
5
+ admin:
6
+ whatson:
7
+ categories:
8
+ category:
9
+ edit: 编辑此类别
10
+ delete: 永久删除此类别
11
+ index:
12
+ no_items_yet: '没有此类别。 点击 "%{create}" 添加第一次类别。'
13
+ comments:
14
+ approved: '评论来自 "%{author}" 已被审批。'
15
+ comment:
16
+ view_live_html: '查看此评论 <br/><em>(opens in a new window)</em>'
17
+ read: 阅读此评论
18
+ reject: 驳回此评论
19
+ approve: 批准此评论
20
+ rejected: '评论来自 "%{author}" 已被驳回。'
21
+ index:
22
+ no_items_yet: '没有 %{type} 评论。'
23
+ show:
24
+ comment: 评论
25
+ whatson_post: 发博
26
+ from: 发布由
27
+ date: 发布在
28
+ message: 评论
29
+ details: 详情
30
+ age: 年龄
31
+ actions: 行动
32
+ back: 返回至所有评论
33
+ reject: 驳回此评论
34
+ approve: 批准此评论
35
+ posts:
36
+ form:
37
+ advanced_options: 高级选项
38
+ toggle_advanced_options: 点击进入标签详解设置和菜单选项
39
+ save_as_draft: 保存为草稿
40
+ published_at: 发布日期
41
+ index:
42
+ no_items_yet: '目前尚未发博。 点击 "%{create}" 添加您的第一篇博文。'
43
+ uncategorized:
44
+ no_items_yet: '没有未归类的博文。'
45
+ post:
46
+ view_live_html: '查看此博 <br/><em>(opens in a new window)</em>'
47
+ edit: 编辑此博
48
+ delete: 永久删除此博
49
+ settings:
50
+ notification_recipients:
51
+ value: 发送通知
52
+ explanation: '每次有人发表评论,发送邮件告知有新评论。'
53
+ hint: '增加新评论时,将会发送邮件告知您。'
54
+ example: "输入您的邮件地址,如: jack@work.com, jill@office.com"
55
+ updated: '通知收件人已被设为 "%{recipients}"'
56
+ submenu:
57
+ categories:
58
+ title: 分类
59
+ manage: 管理
60
+ new: 创建新的类别
61
+ comments:
62
+ title: 评论
63
+ title_with_count: '评论 (%{new_count} new)'
64
+ new: 新
65
+ unmoderated: 新
66
+ approved: 批准
67
+ rejected: 驳回
68
+ posts:
69
+ title: 博文
70
+ manage: 管理博文
71
+ new: 创建新博文
72
+ uncategorized: 未归类博文
73
+ settings:
74
+ title: 设置
75
+ moderation: 等待审核
76
+ update_notified: 更新获得通知的人
77
+ comments: 评论
78
+ whatson:
79
+ comment_mailer:
80
+ notification:
81
+ greeting: 您好
82
+ you_recieved_new_comment: 您刚收到来自网站的一条新评论
83
+ comment_starts: --- 评论开始 ---
84
+ comment_ends: --- 评论结束 ---
85
+ from: 来自
86
+ email: 邮件
87
+ message: 信息
88
+ closing_line: 亲切问候
89
+ ps: 'P.S. All your comments are stored in the "Whatson" section of Refinery under the "Comments" submenu should you ever want to view it later there.'
90
+ shared:
91
+ categories:
92
+ title: 分类
93
+ rss_feed:
94
+ title: RSS源
95
+ subscribe: 订阅
96
+ posts:
97
+ other: 其他博文
98
+ created_at: '发表于 %{when}'
99
+ read_more: 阅读更多
100
+ comments:
101
+ singular: 评论
102
+ none: 没有评论
103
+ archives: 档案
104
+ categories:
105
+ show:
106
+ no_posts: 此处没有文章。
107
+ posts:
108
+ post:
109
+ filed_in: 用户体验
110
+ comment: 评论
111
+ comments:
112
+ by: '发布由 %{who}'
113
+ time_ago: '%{time} 之前'
114
+ thank_you: '感谢您的评论。'
115
+ thank_you_moderated: '感谢您的评论。 您的信息已被列入等待审核队列,并会在短期内出现。'
116
+ index:
117
+ no_whatson_articles_yet: 尚未发布文章。敬请关注。
118
+ show:
119
+ whatson_home: 博客首页
120
+ comments:
121
+ title: 评论
122
+ add: 发表评论
123
+ other: 其他博文
124
+ filed_in: 用户体验
125
+ submit: 发送评论
126
+ archive:
127
+ whatson_archive_for: '博客存档 %{date}'
128
+ no_whatson_articles_posted: '没有发布文章 %{date}。敬请关注。'
data/config/routes.rb ADDED
@@ -0,0 +1,47 @@
1
+ ::Refinery::Application.routes.draw do
2
+ scope(:path => 'whatson', :module => 'whatson') do
3
+ root :to => 'posts#index', :as => 'whatson_root'
4
+ match 'feed.rss', :to => 'posts#index', :as => 'whatson_rss_feed', :defaults => {:format => "rss"}
5
+ match ':id', :to => 'posts#show', :as => 'whatson_post'
6
+ match 'categories/:id', :to => 'categories#show', :as => 'whatson_category'
7
+ match ':id/comments', :to => 'posts#comment', :as => 'whatson_post_whatson_comments'
8
+ get 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_whatson_posts'
9
+ get 'tagged/:tag_id(/:tag_name)' => 'posts#tagged', :as => 'tagged_posts'
10
+ end
11
+
12
+ scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
13
+ scope(:path => 'whatson', :as => 'whatson', :module => 'whatson') do
14
+ root :to => 'posts#index'
15
+ resources :posts do
16
+ collection do
17
+ get :uncategorized
18
+ get :tags
19
+ end
20
+ end
21
+
22
+ resources :categories
23
+
24
+ resources :comments do
25
+ collection do
26
+ get :approved
27
+ get :rejected
28
+ end
29
+ member do
30
+ get :approved
31
+ get :rejected
32
+ end
33
+ end
34
+
35
+ resources :settings do
36
+ collection do
37
+ get :notification_recipients
38
+ post :notification_recipients
39
+
40
+ get :moderation
41
+ get :comments
42
+ get :teasers
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,54 @@
1
+ class CreateWhatsonStructure < ActiveRecord::Migration
2
+
3
+ def self.up
4
+ create_table :whatson_posts, :id => true do |t|
5
+ t.string :title
6
+ t.text :body
7
+ t.boolean :draft
8
+ t.datetime :published_at
9
+ t.timestamps
10
+ end
11
+
12
+ add_index :whatson_posts, :id
13
+
14
+ create_table :whatson_comments, :id => true do |t|
15
+ t.integer :whatson_post_id
16
+ t.boolean :spam
17
+ t.string :name
18
+ t.string :email
19
+ t.text :body
20
+ t.string :state
21
+ t.timestamps
22
+ end
23
+
24
+ add_index :whatson_comments, :id
25
+
26
+ create_table :whatson_categories, :id => true do |t|
27
+ t.string :title
28
+ t.timestamps
29
+ end
30
+
31
+ add_index :whatson_categories, :id
32
+
33
+ create_table :whatson_categories_whatson_posts, :id => false do |t|
34
+ t.integer :whatson_category_id
35
+ t.integer :whatson_post_id
36
+ end
37
+
38
+ add_index :whatson_categories_whatson_posts, [:whatson_category_id, :whatson_post_id], :name => 'index_whatson_categories_whatson_posts_on_bc_and_bp'
39
+
40
+ load(Rails.root.join('db', 'seeds', 'refinerycms_whatson.rb').to_s)
41
+ end
42
+
43
+ def self.down
44
+ UserPlugin.destroy_all({:name => "refinerycms_whatson"})
45
+
46
+ Page.delete_all({:link_url => "/whatson"})
47
+
48
+ drop_table :whatson_posts
49
+ drop_table :whatson_comments
50
+ drop_table :whatson_categories
51
+ drop_table :whatson_categories_whatson_posts
52
+ end
53
+
54
+ end
@@ -0,0 +1,11 @@
1
+ class AddUserIdToWhatsonPosts < ActiveRecord::Migration
2
+
3
+ def self.up
4
+ add_column :whatson_posts, :user_id, :integer
5
+ end
6
+
7
+ def self.down
8
+ remove_column :whatson_posts, :user_id
9
+ end
10
+
11
+ end
@@ -0,0 +1,28 @@
1
+ class ActsAsTaggableOnMigration < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :tags do |t|
4
+ t.string :name
5
+ end
6
+
7
+ create_table :taggings do |t|
8
+ t.references :tag
9
+
10
+ # You should make sure that the column created is
11
+ # long enough to store the required class names.
12
+ t.references :taggable, :polymorphic => true
13
+ t.references :tagger, :polymorphic => true
14
+
15
+ t.string :context
16
+
17
+ t.datetime :created_at
18
+ end
19
+
20
+ add_index :taggings, :tag_id
21
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
22
+ end
23
+
24
+ def self.down
25
+ drop_table :taggings
26
+ drop_table :tags
27
+ end
28
+ end
@@ -0,0 +1,25 @@
1
+ class CreateSeoMetaForWhatson < ActiveRecord::Migration
2
+
3
+ def self.up
4
+ unless ::SeoMetum.table_exists?
5
+ create_table ::SeoMetum.table_name do |t|
6
+ t.integer :seo_meta_id
7
+ t.string :seo_meta_type
8
+
9
+ t.string :browser_title
10
+ t.string :meta_keywords
11
+ t.text :meta_description
12
+
13
+ t.timestamps
14
+ end
15
+
16
+ add_index ::SeoMetum.table_name, :id
17
+ add_index ::SeoMetum.table_name, [:seo_meta_id, :seo_meta_type]
18
+ end
19
+ end
20
+
21
+ def self.down
22
+ # can't drop the table because someone else might be using it.
23
+ end
24
+
25
+ end
@@ -0,0 +1,11 @@
1
+ class AddCachedSlugs < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :whatson_categories, :cached_slug, :string
4
+ add_column :whatson_posts, :cached_slug, :string
5
+ end
6
+
7
+ def self.down
8
+ remove_column :whatson_categories, :cached_slug
9
+ remove_column :whatson_posts, :cached_slug
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class AddCustomUrlFieldToWhatsonPosts < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :whatson_posts, :custom_url, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :whatson_posts, :custom_url
8
+ end
9
+ end