knowledge_base 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +3 -1
  3. data/app/models/knowledge_base/category_article_association.rb +1 -2
  4. data/app/models/knowledge_base/section.rb +1 -5
  5. data/app/models/knowledge_base/sectionables/attachments.rb +7 -0
  6. data/app/models/knowledge_base/sectionables/attachments/attachment.rb +5 -0
  7. data/app/models/knowledge_base/sectionables/attachments/list.rb +5 -0
  8. data/app/models/knowledge_base/sectionables/gallery.rb +3 -7
  9. data/app/models/knowledge_base/sectionables/gallery/image.rb +1 -3
  10. data/app/models/knowledge_base/sectionables/image.rb +3 -7
  11. data/app/models/knowledge_base/sectionables/links.rb +3 -5
  12. data/app/models/knowledge_base/sectionables/links/link.rb +1 -6
  13. data/app/models/knowledge_base/sectionables/links/list.rb +5 -0
  14. data/app/models/knowledge_base/sectionables/list.rb +3 -7
  15. data/app/models/knowledge_base/sectionables/list/item.rb +1 -1
  16. data/app/models/knowledge_base/sectionables/sectionable.rb +3 -7
  17. data/app/models/knowledge_base/sectionables/text.rb +3 -5
  18. data/app/models/knowledge_base/sectionables/video.rb +3 -11
  19. data/app/uploaders/knowledge_base/generic_file_uploader.rb +7 -0
  20. data/app/uploaders/knowledge_base/image_uploader.rb +0 -48
  21. data/app/views/knowledge_base/articles/_article.html.erb +3 -3
  22. data/app/views/knowledge_base/articles/_search.html.erb +6 -0
  23. data/app/views/knowledge_base/articles/index.html.erb +11 -0
  24. data/app/views/knowledge_base/categories/_category.html.erb +2 -2
  25. data/app/views/knowledge_base/sectionables/attachments/lists/_list.html.erb +14 -0
  26. data/app/views/knowledge_base/sectionables/links/lists/_list.html.erb +13 -0
  27. data/app/views/knowledge_base/sectionables/lists/_list.html.erb +4 -0
  28. data/app/views/knowledge_base/sectionables/texts/_text.html.erb +4 -0
  29. data/app/views/knowledge_base/sectionables/videos/_video.html.erb +4 -1
  30. data/config/locales/en.yml +131 -0
  31. data/config/locales/nb.yml +94 -15
  32. data/config/routes.rb +2 -0
  33. data/db/migrate/20140318125210_default_position_fields.rb +10 -0
  34. data/db/migrate/20140318210722_change_knowledge_base_gallery_description_to_text.rb +9 -0
  35. data/db/migrate/20140320125825_add_image_to_texts.rb +5 -0
  36. data/db/migrate/20140325083548_add_image_to_sectionables_lists.rb +5 -0
  37. data/db/migrate/20140404234850_create_knowledge_base_sectionables_attachments.rb +8 -0
  38. data/db/migrate/20140410184906_create_knowledge_base_sectionables_attachment_lists.rb +7 -0
  39. data/db/migrate/20140410185528_add_attachment_list_reference_to_knowledge_base_sectionables_attachments.rb +8 -0
  40. data/db/migrate/20140410191611_migrate_attachments_over_to_lists.rb +49 -0
  41. data/db/migrate/20140410203342_rename_attachment_lists_to_attachments_lists.rb +5 -0
  42. data/db/migrate/20140410205056_rename_attachments_to_attachments_attachments.rb +5 -0
  43. data/db/migrate/20140410224403_rename_links_to_links_lists.rb +5 -0
  44. data/db/migrate/20140410231048_fix_sectionable_types_for_attachments.rb +13 -0
  45. data/db/migrate/20140410231433_fix_sectionable_types_for_links.rb +13 -0
  46. data/db/migrate/20140430112603_add_description_to_knowledge_base_attachments_attachment.rb +5 -0
  47. data/db/migrate/20140430112633_add_description_to_knowledge_base_links_link.rb +5 -0
  48. data/db/migrate/20140820114750_add_custom_style_to_knowledge_base_sectionables.rb +21 -0
  49. data/db/migrate/20140821081854_remove_custom_style_from_non_sectionables.rb +8 -0
  50. data/db/migrate/20140821085102_rename_custom_style_to_style.rb +11 -0
  51. data/db/migrate/20140821151832_add_title_to_knowledge_base_sectionables_videos.rb +5 -0
  52. data/db/migrate/20140930121510_add_title_to_attachment_lists.rb +5 -0
  53. data/fixtures/parrot.png +0 -0
  54. data/fixtures/sample.pdf +0 -0
  55. data/lib/generators/knowledge_base/active_admin/USAGE +8 -0
  56. data/lib/generators/knowledge_base/active_admin/active_admin_generator.rb +9 -0
  57. data/lib/generators/knowledge_base/active_admin/templates/article.rb +92 -0
  58. data/lib/generators/knowledge_base/active_admin/templates/category.rb +70 -0
  59. data/lib/generators/knowledge_base/active_admin/templates/sectionables/attachments/list.rb +25 -0
  60. data/lib/generators/knowledge_base/active_admin/templates/sectionables/gallery.rb +44 -0
  61. data/lib/generators/knowledge_base/active_admin/templates/sectionables/image.rb +37 -0
  62. data/lib/generators/knowledge_base/active_admin/templates/sectionables/links/list.rb +35 -0
  63. data/lib/generators/knowledge_base/active_admin/templates/sectionables/list.rb +48 -0
  64. data/lib/generators/knowledge_base/active_admin/templates/sectionables/text.rb +42 -0
  65. data/lib/generators/knowledge_base/active_admin/templates/sectionables/video.rb +20 -0
  66. data/lib/knowledge_base.rb +3 -0
  67. data/lib/knowledge_base/concerns/controllers/articles_controller.rb +21 -2
  68. data/lib/knowledge_base/concerns/controllers/categories_controller.rb +3 -2
  69. data/lib/knowledge_base/concerns/models.rb +31 -0
  70. data/lib/knowledge_base/concerns/models/article.rb +4 -3
  71. data/lib/knowledge_base/concerns/models/category.rb +2 -3
  72. data/lib/knowledge_base/concerns/models/category_article_association.rb +8 -0
  73. data/lib/knowledge_base/concerns/models/section.rb +13 -0
  74. data/lib/knowledge_base/concerns/models/sectionables/attachments/attachment.rb +11 -0
  75. data/lib/knowledge_base/concerns/models/sectionables/attachments/list.rb +15 -0
  76. data/lib/knowledge_base/concerns/models/sectionables/gallery.rb +17 -0
  77. data/lib/knowledge_base/concerns/models/sectionables/gallery/image.rb +9 -0
  78. data/lib/knowledge_base/concerns/models/sectionables/image.rb +13 -0
  79. data/lib/knowledge_base/concerns/models/sectionables/links/link.rb +7 -0
  80. data/lib/knowledge_base/concerns/models/sectionables/links/list.rb +15 -0
  81. data/lib/knowledge_base/concerns/models/sectionables/list.rb +17 -0
  82. data/lib/knowledge_base/concerns/models/sectionables/list/item.rb +7 -0
  83. data/lib/knowledge_base/concerns/models/sectionables/sectionable.rb +28 -0
  84. data/lib/knowledge_base/concerns/models/sectionables/text.rb +13 -0
  85. data/lib/knowledge_base/concerns/models/sectionables/video.rb +15 -0
  86. data/lib/knowledge_base/configuration.rb +10 -17
  87. data/lib/knowledge_base/engine.rb +4 -0
  88. data/lib/knowledge_base/seeds.rb +7 -3
  89. data/lib/knowledge_base/version.rb +1 -1
  90. data/spec/controllers/knowledge_base/articles_controller_spec.rb +15 -4
  91. data/spec/controllers/knowledge_base/categories_controller_spec.rb +1 -1
  92. data/spec/dummy/db/development.sqlite3 +0 -0
  93. data/spec/dummy/db/schema.rb +39 -13
  94. data/spec/dummy/db/test.sqlite3 +0 -0
  95. data/spec/dummy/log/development.log +887 -0
  96. data/spec/dummy/log/test.log +999 -0
  97. data/spec/factories/knowledge_base_articles.rb +3 -3
  98. data/spec/factories/knowledge_base_categories.rb +3 -3
  99. data/spec/factories/knowledge_base_sectionables_attachment_lists.rb +6 -0
  100. data/spec/lib/knowledge_base/configuration_spec.rb +32 -8
  101. data/spec/lib/knowledge_base_spec.rb +3 -3
  102. data/spec/models/knowledge_base/article_spec.rb +0 -1
  103. data/spec/models/knowledge_base/category_article_association_spec.rb +0 -1
  104. data/spec/models/knowledge_base/category_spec.rb +0 -1
  105. data/spec/models/knowledge_base/section_spec.rb +0 -1
  106. data/spec/models/knowledge_base/sectionables/attachments/attachment_spec.rb +6 -0
  107. data/spec/models/knowledge_base/sectionables/attachments/list_spec.rb +13 -0
  108. data/spec/models/knowledge_base/sectionables/gallery/image_spec.rb +0 -1
  109. data/spec/models/knowledge_base/sectionables/gallery_spec.rb +0 -1
  110. data/spec/models/knowledge_base/sectionables/image_spec.rb +0 -1
  111. data/spec/models/knowledge_base/sectionables/links/link_spec.rb +0 -1
  112. data/spec/models/knowledge_base/sectionables/links_spec.rb +0 -1
  113. data/spec/models/knowledge_base/sectionables/list/item_spec.rb +0 -1
  114. data/spec/models/knowledge_base/sectionables/list_spec.rb +0 -1
  115. data/spec/models/knowledge_base/sectionables/sectionable_spec.rb +34 -0
  116. data/spec/models/knowledge_base/sectionables/text_spec.rb +0 -1
  117. data/spec/models/knowledge_base/sectionables/video_spec.rb +0 -7
  118. data/spec/spec_helper.rb +3 -0
  119. data/spec/views/knowledge_base/articles/show.html.erb_spec.rb +0 -1
  120. data/spec/views/knowledge_base/categories/index.html.erb_spec.rb +0 -1
  121. data/spec/views/knowledge_base/categories/show.html.erb_spec.rb +0 -1
  122. metadata +179 -7
  123. data/app/views/knowledge_base/sectionables/links/_links.html.erb +0 -5
@@ -9,13 +9,12 @@ module KnowledgeBase::Concerns::Models::Category
9
9
  friendly_id :title, use: :slugged
10
10
 
11
11
  belongs_to :category
12
- has_many :category_article_associations
12
+ has_many :category_article_associations, -> { order 'position ASC' }
13
13
  has_many :articles, through: :category_article_associations
14
14
 
15
- accepts_nested_attributes_for :category_article_associations
15
+ accepts_nested_attributes_for :category_article_associations, allow_destroy: true
16
16
 
17
17
  scope :root, -> { where parent_id: nil }
18
- scope :published, -> { where published: true }
19
18
 
20
19
  def to_s
21
20
  title
@@ -0,0 +1,8 @@
1
+ module KnowledgeBase::Concerns::Models::CategoryArticleAssociation
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ belongs_to :category
6
+ belongs_to :article
7
+ end
8
+ end
@@ -0,0 +1,13 @@
1
+ module KnowledgeBase::Concerns::Models::Section
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ # It sounds wrong that a section "belongs to" a sectionable, but we want the foreign
6
+ # key to be on this side and declaring `belongs_to` is the only way to do that.
7
+ belongs_to :sectionable, polymorphic: true
8
+
9
+ belongs_to :container, polymorphic: true
10
+
11
+ validates :sectionable, presence: true
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Attachments::Attachment
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ belongs_to :list, foreign_key: :attachment_list_id
6
+
7
+ mount_uploader :file, KnowledgeBase::GenericFileUploader
8
+
9
+ validates :title, :file, :list, presence: true
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Attachments::List
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ has_many :sections, as: :sectionable, dependent: :destroy
6
+
7
+ has_many :attachments, dependent: :destroy, inverse_of: :list,
8
+ foreign_key: :attachment_list_id
9
+ accepts_nested_attributes_for :attachments, allow_destroy: true
10
+
11
+ def to_s
12
+ "#{super} ##{id}: #{title}"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Gallery
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ has_many :images, -> { order position: :asc },
6
+ dependent: :destroy
7
+
8
+ has_many :sections, as: :sectionable, dependent: :destroy
9
+
10
+ accepts_nested_attributes_for :images, allow_destroy: true
11
+
12
+ def to_s
13
+ "#{super} ##{id}: #{title}"
14
+ end
15
+ end
16
+ end
17
+
@@ -0,0 +1,9 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Gallery::Image
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ belongs_to :gallery
6
+
7
+ mount_uploader :image, KnowledgeBase.config.gallery_image_uploader
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Image
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ mount_uploader :image, KnowledgeBase.config.image_image_uploader
6
+
7
+ has_many :sections, as: :sectionable, dependent: :destroy
8
+
9
+ def to_s
10
+ "#{super} ##{id}: #{caption}"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Links::Link
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ belongs_to :list, foreign_key: :links_id
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Links::List
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ has_many :links, dependent: :destroy, foreign_key: :links_id
6
+
7
+ has_many :sections, as: :sectionable, dependent: :destroy
8
+
9
+ accepts_nested_attributes_for :links, allow_destroy: true
10
+
11
+ def to_s
12
+ "#{super} ##{id}: #{links.map(&:title).join(', ')}"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::List
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ mount_uploader :image, KnowledgeBase.config.list_image_uploader
6
+
7
+ has_many :items, -> { order 'position ASC' }
8
+
9
+ has_many :sections, as: :sectionable, dependent: :destroy
10
+
11
+ accepts_nested_attributes_for :items, allow_destroy: true
12
+
13
+ def to_s
14
+ "#{super} ##{id}: #{title}"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,7 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::List::Item
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ belongs_to :list
6
+ end
7
+ end
@@ -0,0 +1,28 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Sectionable
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ extend Enumerize
6
+
7
+ def self.inherited(child)
8
+ model_name = snake_case_class_name child.name
9
+ styles = KnowledgeBase.config.section_styles[model_name] || [ ]
10
+ child.enumerize :style, in: styles
11
+
12
+ super
13
+ end
14
+
15
+ self.abstract_class = true
16
+
17
+ def to_s
18
+ self.class.model_name.human
19
+ end
20
+
21
+ private
22
+
23
+ def self.snake_case_class_name(class_name)
24
+ class_name.gsub("KnowledgeBase::Sectionables::", "").underscore.gsub("/", "_").to_sym
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,13 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Text
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ mount_uploader :image, KnowledgeBase.config.text_image_uploader
6
+
7
+ has_many :sections, as: :sectionable, dependent: :destroy
8
+
9
+ def to_s
10
+ "#{super} ##{id}: #{heading}"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ module KnowledgeBase::Concerns::Models::Sectionables::Video
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ include Embeddable
6
+
7
+ embeddable :video, from: :url
8
+
9
+ has_many :sections, as: :sectionable, dependent: :destroy
10
+
11
+ def to_s
12
+ "#{super} ##{id}: #{url}"
13
+ end
14
+ end
15
+ end
@@ -1,23 +1,16 @@
1
1
  module KnowledgeBase
2
2
  class Configuration
3
- configs = {
4
- storage: :file,
5
- categories_path: 'categories',
6
- articles_path: 'articles'
7
- }
3
+ attr_accessor :categories_path, :articles_path, :text_image_uploader,
4
+ :image_image_uploader, :gallery_image_uploader, :list_image_uploader, :section_styles
8
5
 
9
- configs.each do |config, default|
10
- attr_writer config
11
-
12
- define_method config do
13
- value = instance_variable_get "@#{config}"
14
-
15
- if value.nil?
16
- default
17
- else
18
- value
19
- end
20
- end
6
+ def initialize
7
+ @categories_path = 'categories'
8
+ @articles_path = 'articles'
9
+ @text_image_uploader = KnowledgeBase::ImageUploader
10
+ @image_image_uploader = KnowledgeBase::ImageUploader
11
+ @gallery_image_uploader = KnowledgeBase::ImageUploader
12
+ @list_image_uploader = KnowledgeBase::ImageUploader
13
+ @section_styles = { }
21
14
  end
22
15
  end
23
16
  end
@@ -11,6 +11,10 @@ module KnowledgeBase
11
11
  end
12
12
  end
13
13
 
14
+ initializer 'tasks.factories', after: 'factory_girl.set_factory_paths' do
15
+ FactoryGirl.definition_file_paths << File.expand_path('../../../spec/factories', __FILE__) if defined?(FactoryGirl)
16
+ end
17
+
14
18
  config.generators do |g|
15
19
  g.test_framework :rspec, fixture: false
16
20
  g.fixture_replacement :factory_girl, dir: 'spec/factories'
@@ -6,8 +6,8 @@ def fixture file
6
6
  File.open "#{File.expand_path File.dirname(__FILE__)}/../../fixtures/#{file}"
7
7
  end
8
8
 
9
- category = KnowledgeBase::Category.create! title: Faker::Lorem.words.join, description: Faker::Lorem.sentence
10
- article = KnowledgeBase::Article.create! title: Faker::Lorem.words.join, description: Faker::Lorem.sentence
9
+ category = KnowledgeBase::Category.create! title: Faker::Lorem.words.join, description: Faker::Lorem.sentence, published_at: Time.now
10
+ article = KnowledgeBase::Article.create! title: Faker::Lorem.words.join, description: Faker::Lorem.sentence, published_at: Time.now
11
11
  association = KnowledgeBase::CategoryArticleAssociation.create! category: category, article: article
12
12
 
13
13
  text = KnowledgeBase::Sectionables::Text.create! heading: Faker::Lorem.words.join, lead: Faker::Lorem.sentence, body: Faker::Lorem.paragraph
@@ -27,6 +27,10 @@ list = KnowledgeBase::Sectionables::List.create! title: Faker::Lorem.sentence, d
27
27
  2.times { list.items.create title: Faker::Lorem.sentence, body: Faker::Lorem.paragraph }
28
28
  section = KnowledgeBase::Section.create! sectionable: list, container: article, position: 5
29
29
 
30
- links = KnowledgeBase::Sectionables::Links.create!
30
+ links = KnowledgeBase::Sectionables::Links::List.create!
31
31
  2.times { links.links.create title: Faker::Lorem.word, url: 'http://example.org' }
32
32
  section = KnowledgeBase::Section.create! sectionable: links, container: article, position: 6
33
+
34
+ attachments = KnowledgeBase::Sectionables::Attachments::List.create!
35
+ 2.times { attachments.attachments.create! title: Faker::Lorem.word, file: fixture('sample.pdf') }
36
+ section = KnowledgeBase::Section.create! sectionable: attachments, container: article, position: 7
@@ -1,3 +1,3 @@
1
1
  module KnowledgeBase
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -4,13 +4,24 @@ module KnowledgeBase
4
4
  describe ArticlesController do
5
5
  routes { KnowledgeBase::Engine.routes }
6
6
 
7
+ describe "GET 'index'" do
8
+ let!(:articles) { create_list :article, 3, :published }
9
+
10
+ it "returns http success" do
11
+ get :index
12
+
13
+ articles = assigns :articles
14
+
15
+ expect(response).to be_success
16
+ expect(articles.count).to eq 3
17
+ end
18
+ end
19
+
7
20
  describe "GET 'show'" do
8
21
  it "returns http success" do
9
- category = create :category
10
- article = create :article
11
- association = create :category_article_association, category: category, article: article
22
+ article = create :article, :published
12
23
 
13
- get :show, category_id: category.slug, id: article.slug
24
+ get :show, id: article.slug
14
25
 
15
26
  response.should be_success
16
27
  end
@@ -13,7 +13,7 @@ module KnowledgeBase
13
13
 
14
14
  describe "GET 'show'" do
15
15
  it "returns http success" do
16
- category = create :category
16
+ category = create :category, :published
17
17
 
18
18
  get :show, id: category.slug
19
19
 
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20140307092719) do
14
+ ActiveRecord::Schema.define(version: 20140930121510) do
15
15
 
16
16
  create_table "knowledge_base_articles", force: true do |t|
17
17
  t.string "title"
@@ -27,7 +27,7 @@ ActiveRecord::Schema.define(version: 20140307092719) do
27
27
  t.string "slug"
28
28
  t.text "description"
29
29
  t.integer "category_id"
30
- t.integer "position"
30
+ t.integer "position", default: 0
31
31
  t.datetime "published_at"
32
32
  t.datetime "created_at"
33
33
  t.datetime "updated_at"
@@ -39,7 +39,7 @@ ActiveRecord::Schema.define(version: 20140307092719) do
39
39
  create_table "knowledge_base_category_article_associations", force: true do |t|
40
40
  t.integer "category_id"
41
41
  t.integer "article_id"
42
- t.integer "position"
42
+ t.integer "position", default: 0
43
43
  t.datetime "created_at"
44
44
  t.datetime "updated_at"
45
45
  end
@@ -47,17 +47,34 @@ ActiveRecord::Schema.define(version: 20140307092719) do
47
47
  add_index "knowledge_base_category_article_associations", ["article_id"], name: "index_knowledge_base_c_a_association_on_article_id"
48
48
  add_index "knowledge_base_category_article_associations", ["category_id"], name: "index_knowledge_base_c_a_association_on_category_id"
49
49
 
50
+ create_table "knowledge_base_sectionables_attachments_attachments", force: true do |t|
51
+ t.string "title"
52
+ t.string "file"
53
+ t.integer "attachment_list_id"
54
+ t.text "description"
55
+ end
56
+
57
+ add_index "knowledge_base_sectionables_attachments_attachments", ["attachment_list_id"], name: "index_knowledge_base_attachments_on_attachment_list_id"
58
+
59
+ create_table "knowledge_base_sectionables_attachments_lists", force: true do |t|
60
+ t.datetime "created_at"
61
+ t.datetime "updated_at"
62
+ t.string "style"
63
+ t.string "title"
64
+ end
65
+
50
66
  create_table "knowledge_base_sectionables_galleries", force: true do |t|
51
67
  t.string "title"
52
- t.string "description"
68
+ t.text "description"
53
69
  t.datetime "created_at"
54
70
  t.datetime "updated_at"
71
+ t.string "style"
55
72
  end
56
73
 
57
74
  create_table "knowledge_base_sectionables_gallery_images", force: true do |t|
58
75
  t.string "caption"
59
76
  t.string "image"
60
- t.integer "position"
77
+ t.integer "position", default: 0
61
78
  t.integer "gallery_id"
62
79
  t.datetime "created_at"
63
80
  t.datetime "updated_at"
@@ -70,26 +87,29 @@ ActiveRecord::Schema.define(version: 20140307092719) do
70
87
  t.string "image"
71
88
  t.datetime "created_at"
72
89
  t.datetime "updated_at"
73
- end
74
-
75
- create_table "knowledge_base_sectionables_links", force: true do |t|
76
- t.datetime "created_at"
77
- t.datetime "updated_at"
90
+ t.string "style"
78
91
  end
79
92
 
80
93
  create_table "knowledge_base_sectionables_links_links", force: true do |t|
81
94
  t.string "title"
82
95
  t.string "url"
83
- t.integer "position"
96
+ t.integer "position", default: 0
84
97
  t.integer "links_id"
85
98
  t.datetime "created_at"
86
99
  t.datetime "updated_at"
100
+ t.text "description"
101
+ end
102
+
103
+ create_table "knowledge_base_sectionables_links_lists", force: true do |t|
104
+ t.datetime "created_at"
105
+ t.datetime "updated_at"
106
+ t.string "style"
87
107
  end
88
108
 
89
109
  create_table "knowledge_base_sectionables_list_items", force: true do |t|
90
110
  t.string "title"
91
111
  t.text "body"
92
- t.integer "position"
112
+ t.integer "position", default: 0
93
113
  t.integer "list_id"
94
114
  t.datetime "created_at"
95
115
  t.datetime "updated_at"
@@ -102,6 +122,8 @@ ActiveRecord::Schema.define(version: 20140307092719) do
102
122
  t.text "description"
103
123
  t.datetime "created_at"
104
124
  t.datetime "updated_at"
125
+ t.string "image"
126
+ t.string "style"
105
127
  end
106
128
 
107
129
  create_table "knowledge_base_sectionables_texts", force: true do |t|
@@ -110,18 +132,22 @@ ActiveRecord::Schema.define(version: 20140307092719) do
110
132
  t.text "body"
111
133
  t.datetime "created_at"
112
134
  t.datetime "updated_at"
135
+ t.string "image"
136
+ t.string "style"
113
137
  end
114
138
 
115
139
  create_table "knowledge_base_sectionables_videos", force: true do |t|
116
140
  t.string "url"
117
141
  t.datetime "created_at"
118
142
  t.datetime "updated_at"
143
+ t.string "style"
144
+ t.string "title"
119
145
  end
120
146
 
121
147
  create_table "knowledge_base_sections", force: true do |t|
122
148
  t.integer "sectionable_id"
123
149
  t.string "sectionable_type"
124
- t.integer "position"
150
+ t.integer "position", default: 0
125
151
  t.datetime "created_at"
126
152
  t.datetime "updated_at"
127
153
  t.integer "container_id"