phcpress 9.1.2 → 10.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d8153bd3d2e72bb733fb4e21b6c4aef72334f23
4
- data.tar.gz: 9ddc7ebad605b5b349623c740ef9a3d9b85b162c
3
+ metadata.gz: 3450511990358a3eb585a109064da119f3143342
4
+ data.tar.gz: 0c93121893b4b7a051a0fb1ae744e6fd1dc2cf67
5
5
  SHA512:
6
- metadata.gz: a096ce224377c7eb529459b162e49ea2c8104db8e678c5350aa3baf6f7bd48f8b83a51ac7c078f5060decdac1877965feb937735f022d4c095ee262f1e7fabfd
7
- data.tar.gz: 7559ecba25b584e1629817f72b3b179f07054ae1e98dc0a63be0223f45a33bca4d677f2b972e0be85525909ed998805bc1719260ca90b8ab6de74cc74bb30a6c
6
+ metadata.gz: ce52c0bcc4f45f6e18d360a2ffda384c5a895ab0bd0703bc237b52de024d55eb5132e0497a6544dddc26aa5f74c0e6302897996e1717a3f6e808ba31d67670b1
7
+ data.tar.gz: bdf60a2e06e37ffb1e613fca0a1ed8dbe8c7ead686f4d9da3068dfa8669c3e84100c6b788e7c0e8c2ab7660dfd7d6dcfb99e7b97a2644366b26e8d2ec74f12c3
data/README.md CHANGED
@@ -13,7 +13,7 @@ PHCPress rails CMS engine to manage your website's articles, categories and medi
13
13
 
14
14
  #### Step 1 - Add PHCPress to your gemfile and run command
15
15
 
16
- gem 'phcpress', '~> 9.1', '>= 9.1.1'
16
+ gem 'phcpress', '~> 9.1', '>= 9.1.2'
17
17
  bundle install
18
18
 
19
19
  #### Step 2 - Copy PHCPress Database Tables
@@ -0,0 +1,67 @@
1
+ require_dependency "phcpress/application_controller"
2
+
3
+ module Phcpress
4
+ class Article::PostsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :set_article_post, only: [:show, :edit, :update, :destroy]
8
+
9
+ # Article Index
10
+ def index
11
+ @article_posts = Article::Post.all
12
+ end
13
+
14
+ # Article Show
15
+ def show
16
+ end
17
+
18
+ # Article New
19
+ def new
20
+ @article_post = Article::Post.new
21
+ end
22
+
23
+ # Article Edit
24
+ def edit
25
+ end
26
+
27
+ # POST
28
+ def create
29
+ @article_post = Article::Post.new(article_post_params)
30
+ if @article_post.save
31
+ @article_post.connections.build
32
+ redirect_to article_posts_url, notice: 'Post was successfully created.'
33
+ else
34
+ render :new
35
+ end
36
+ end
37
+
38
+ # PATCH/PUT
39
+ def update
40
+ if @article_post.update(article_post_params)
41
+ @article_post.connections.build
42
+ redirect_to article_posts_url, notice: 'Post was successfully updated.'
43
+ else
44
+ render :edit
45
+ end
46
+ end
47
+
48
+ # DELETE
49
+ def destroy
50
+ @article_post.destroy
51
+ redirect_to article_posts_url, notice: 'Post was successfully destroyed.'
52
+ end
53
+
54
+ private
55
+
56
+ # Common Callbacks
57
+ def set_article_post
58
+ @article_post = Article::Post.find(params[:id])
59
+ end
60
+
61
+ # Params Whitelist
62
+ def article_post_params
63
+ params.require(:article_post).permit(:psttitle, :psttext, :pststatus, :pstimage, :remove_pstimage, category_ids: [])
64
+ end
65
+
66
+ end
67
+ end
@@ -1,7 +1,7 @@
1
1
  module Phcpress
2
- module Articles
2
+ module Article
3
3
  def self.table_name_prefix
4
- 'phcpress_articles_'
4
+ 'phcpress_article_'
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,40 @@
1
+ module Phcpress
2
+ class Article::Post < ApplicationRecord
3
+
4
+ # Clean URL Initialize
5
+ extend FriendlyId
6
+
7
+ # Add Paper Trail
8
+ has_paper_trail :class_name => 'Phcprss::PostVersions'
9
+
10
+ # Image Upload Initialize
11
+ mount_uploader :pstimage, Phcpress::PstimageUploader
12
+
13
+ # Model Relationships
14
+ has_many :connections, class_name: 'Phcpress::Modules::Connection', dependent: :destroy
15
+ has_many :categories, class_name: 'Phcpress::Modules::Category', :through => :connections
16
+
17
+ # Validation for Form Fields
18
+ validates :psttitle,
19
+ presence: true,
20
+ length: { minimum: 3 }
21
+
22
+ validates :psttext,
23
+ presence: true,
24
+ length: { minimum: 3 }
25
+
26
+ validates :pststatus,
27
+ presence: true
28
+
29
+ # Clean URL Define
30
+ friendly_id :phcpress_posts_slug, use: [:slugged, :finders]
31
+
32
+ # Define for Multiple Records
33
+ def phcpress_posts_slug
34
+ [
35
+ [:psttitle]
36
+ ]
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,5 @@
1
+ module Phcpress
2
+ class CategoryVersions < PaperTrail::Version
3
+ self.table_name = :phcpress_category_versions
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Phcpress
2
+ class PostVersions < PaperTrail::Version
3
+ self.table_name = :phcpress_post_versions
4
+ end
5
+ end
@@ -1,8 +1,8 @@
1
1
  <div class="row">
2
- <%= form_for(@articles_post, :html => {:multipart => true}) do |f| %>
2
+ <%= form_for(@article_post, :html => {:multipart => true}) do |f| %>
3
3
 
4
4
  <!-- PHC-Notifi Render Validation -->
5
- <%= render 'phcnotifi/validations', :object => @articles_post %>
5
+ <%= render 'phcnotifi/validations', :object => @article_post %>
6
6
 
7
7
  <div class="col-md-3">
8
8
 
@@ -40,7 +40,7 @@
40
40
 
41
41
  <div class="panel panel-primary">
42
42
  <div class="panel-heading">
43
- <i class="fa fa-sitemap"></i> Post Categories & Tags
43
+ <i class="fa fa-sitemap"></i> Post Categories &amp; Tags
44
44
  </div>
45
45
  <div class="panel-body">
46
46
  <div class="form-group">
@@ -53,7 +53,6 @@
53
53
  </div>
54
54
 
55
55
  </div>
56
-
57
56
  <div class="col-md-9 ">
58
57
 
59
58
  <div class="panel panel-primary">
@@ -61,9 +60,7 @@
61
60
  <i class="fa fa-pencil-square-o"></i> Blog Post Publisher
62
61
  </div>
63
62
  <div class="panel-body">
64
-
65
- <%= render 'phcnotifi/validations', :object => @articles_post %>
66
-
63
+ <%= render 'phcnotifi/validations', :object => @article_post %>
67
64
  <div class="form-group">
68
65
  <%= f.label :psttext, "Post Title" %>
69
66
  <%= f.text_field :psttitle, class: "form-control" %>
@@ -72,13 +69,12 @@
72
69
  <%= f.label :psttext, "Post Text" %>
73
70
  <%= f.text_area :psttext, :class => "tinymce form-control", :rows => 20, :cols => 60 %>
74
71
  </div>
75
-
76
72
  </div>
77
73
  </div>
78
74
 
79
75
  </div>
80
-
81
76
  <% end %>
82
77
  </div>
83
78
 
79
+ <!-- Tinymce Javascript -->
84
80
  <%= tinymce %>
@@ -1,7 +1,7 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Article Manager" %>
3
3
  <% phc_title_tagline "Update Article" %>
4
- <% phc_breadcrumb_one link_to "Article Index", phcpress.articles_posts_path %>
4
+ <% phc_breadcrumb_one link_to "Article Index", phcpress.article_posts_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
@@ -23,7 +23,7 @@
23
23
  <div class="col-lg-12">
24
24
 
25
25
  <!-- Page Form (Edit) -->
26
- <%= render 'form', articles_post: @articles_post %>
26
+ <%= render 'form', article_post: @article_post %>
27
27
  <!-- Page Form (Edit) -->
28
28
 
29
29
  </div>
@@ -1,7 +1,7 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Article Manager" %>
3
3
  <% phc_title_tagline "Article Index" %>
4
- <% phc_breadcrumb_one link_to "Article Index", phcpress.articles_posts_path %>
4
+ <% phc_breadcrumb_one link_to "Article Index", phcpress.article_posts_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
@@ -39,14 +39,14 @@
39
39
  </tr>
40
40
  </thead>
41
41
  <tbody>
42
- <% @articles_posts.each do |articles_post| %>
42
+ <% @article_posts.each do |article_post| %>
43
43
  <tr>
44
- <td><%= articles_post.psttitle %></td>
45
- <td><%= truncate(articles_post.psttext, :length => 80) %></td>
46
- <td><%= articles_post.pststatus %></td>
44
+ <td><%= article_post.psttitle %></td>
45
+ <td><%= truncate(article_post.psttext, :length => 80) %></td>
46
+ <td><%= article_post.pststatus %></td>
47
47
  <td><div class="btn-group" role="group" aria-label="Blog Articles">
48
- <%= link_to 'Edit', edit_articles_post_path(articles_post), class: "btn btn-primary btn-xs" %>
49
- <%= link_to 'Delete', articles_post, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
48
+ <%= link_to 'Edit', edit_article_post_path(articles_post), class: "btn btn-primary btn-xs" %>
49
+ <%= link_to 'Delete', article_post, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
50
50
  </div></td>
51
51
  </tr>
52
52
  <% end %>
@@ -57,7 +57,7 @@
57
57
 
58
58
  <!-- Panel Footer -->
59
59
  <div class="box-footer clearfix">
60
- <%= link_to 'New Blog Post', new_articles_post_path, class: "btn btn-primary" %>
60
+ <%= link_to 'New Blog Post', new_article_post_path, class: "btn btn-primary" %>
61
61
  </div>
62
62
  <!-- Panel Footer -->
63
63
 
@@ -1,7 +1,7 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Article Manager" %>
3
3
  <% phc_title_tagline "Create a New Article" %>
4
- <% phc_breadcrumb_one link_to "Article Index", phcpress.articles_posts_path %>
4
+ <% phc_breadcrumb_one link_to "Article Index", phcpress.article_posts_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
@@ -23,7 +23,7 @@
23
23
  <div class="col-lg-12">
24
24
 
25
25
  <!-- Page Form (New) -->
26
- <%= render 'form', articles_post: @articles_post %>
26
+ <%= render 'form', article_post: @article_post %>
27
27
  <!-- Page Form (New) -->
28
28
 
29
29
  </div>
@@ -1,7 +1,7 @@
1
1
  <!-- Title System -->
2
2
  <% phc_title "Article Manager" %>
3
3
  <% phc_title_tagline "Article Details" %>
4
- <% phc_breadcrumb_one link_to "Article Index", phcpress.articles_posts_path %>
4
+ <% phc_breadcrumb_one link_to "Article Index", phcpress.article_posts_path %>
5
5
  <% phc_breadcrumb_two yield(:phc_title_tagline) %>
6
6
  <!-- Title System -->
7
7
 
@@ -28,8 +28,8 @@
28
28
  <div class="box-body">
29
29
 
30
30
  <!-- Show Content -->
31
- <%= link_to 'Edit', edit_articles_post_path(@articles_post) %> |
32
- <%= link_to 'Back', articles_posts_path %>
31
+ <%= link_to 'Edit', edit_article_post_path(@article_post) %> |
32
+ <%= link_to 'Back', article_posts_path %>
33
33
  <!-- Show Content -->
34
34
 
35
35
  </div>
@@ -17,7 +17,7 @@ FriendlyId.defaults do |config|
17
17
  config.use :reserved
18
18
 
19
19
  config.reserved_words = %w(new edit index session login logout users admin
20
- stylesheets assets javascripts images)
20
+ stylesheets assets javascripts images)
21
21
 
22
22
  # ## Friendly Finders
23
23
  #
@@ -38,14 +38,14 @@ FriendlyId.defaults do |config|
38
38
  # performance because it will avoid Rails-internal code that makes runtime
39
39
  # calls to `Module.extend`.
40
40
  #
41
- # config.use :finders
41
+ config.use :finders
42
42
  #
43
43
  # ## Slugs
44
44
  #
45
45
  # Most applications will use the :slugged module everywhere. If you wish
46
46
  # to do so, uncomment the following line.
47
47
  #
48
- # config.use :slugged
48
+ config.use :slugged
49
49
  #
50
50
  # By default, FriendlyId's :slugged addon expects the slug column to be named
51
51
  # 'slug', but you can change it if you wish.
@@ -0,0 +1,10 @@
1
+ # config/initializers/locale.rb
2
+
3
+ # Where the I18n library should search for translation files
4
+ I18n.load_path += Dir[Rails.root.join('lib', 'locale', '*.{rb,yml}')]
5
+
6
+ # Whitelist locales available for the application
7
+ I18n.available_locales = [:en, :pt]
8
+
9
+ # Set default locale to something other than :en
10
+ I18n.default_locale = :en
@@ -0,0 +1 @@
1
+ PaperTrail.config.track_associations = false
@@ -1,7 +1,7 @@
1
- class CreatePhcpressArticlesPosts < ActiveRecord::Migration[5.1]
1
+ class CreatePhcpressArticlePosts < ActiveRecord::Migration[5.1]
2
2
  def change
3
3
 
4
- create_table :phcpress_articles_posts do |t|
4
+ create_table :phcpress_article_posts do |t|
5
5
 
6
6
  t.string :psttitle
7
7
  t.text :psttext
@@ -0,0 +1,18 @@
1
+ class CreatePhcmembersFriendlyIdSlugs < ActiveRecord::Migration[5.1]
2
+ def change
3
+
4
+ create_table :phcpress_friendly_id_slugs do |t|
5
+ t.string :slug, :null => false
6
+ t.integer :sluggable_id, :null => false
7
+ t.string :sluggable_type, :limit => 50
8
+ t.string :scope
9
+ t.datetime :created_at
10
+ end
11
+
12
+ add_index :phcpress_friendly_id_slugs, :sluggable_id
13
+ add_index :phcpress_friendly_id_slugs, [:slug, :sluggable_type], length: { slug: 140, sluggable_type: 50 }
14
+ add_index :phcpress_friendly_id_slugs, [:slug, :sluggable_type, :scope], name: 'phcpress_fri_id_slugable_scope_type', length: { slug: 70, sluggable_type: 50, scope: 70 }, unique: true
15
+ add_index :phcpress_friendly_id_slugs, :sluggable_type
16
+
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ class CreatePhcpressPostVersions < ActiveRecord::Migration[5.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcpress_post_versions do |t|
6
+ t.string :item_type, {:null=>false}
7
+ t.integer :item_id, null: false
8
+ t.string :event, null: false
9
+ t.string :whodunnit
10
+ t.text :object, limit: TEXT_BYTES
11
+ t.datetime :created_at
12
+ end
13
+
14
+ add_index :phcpress_post_versions, %i(item_type item_id), :name => 'press_post_versions'
15
+
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ class CreatePhcpressCategoryVersions < ActiveRecord::Migration[5.1]
2
+ TEXT_BYTES = 1_073_741_823
3
+ def change
4
+
5
+ create_table :phcpress_category_versions do |t|
6
+ t.string :item_type, {:null=>false}
7
+ t.integer :item_id, null: false
8
+ t.string :event, null: false
9
+ t.string :whodunnit
10
+ t.text :object, limit: TEXT_BYTES
11
+ t.datetime :created_at
12
+ end
13
+ add_index :phcpress_category_versions, %i(item_type item_id), :name => 'press_category_versions'
14
+
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Phcpress
2
- VERSION = "9.1.2"
2
+ VERSION = "10.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcpress
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.1.2
4
+ version: 10.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-06 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -689,7 +689,7 @@ files:
689
689
  - app/controllers/phcpress/api/v1/categories_controller.rb
690
690
  - app/controllers/phcpress/api/v1/posts_controller.rb
691
691
  - app/controllers/phcpress/application_controller.rb
692
- - app/controllers/phcpress/articles/posts_controller.rb
692
+ - app/controllers/phcpress/article/posts_controller.rb
693
693
  - app/controllers/phcpress/frontend/articles_controller.rb
694
694
  - app/controllers/phcpress/modules/categories_controller.rb
695
695
  - app/controllers/phcpress/modules/connections_controller.rb
@@ -699,13 +699,15 @@ files:
699
699
  - app/models/phcpress/api/v1/category.rb
700
700
  - app/models/phcpress/api/v1/post.rb
701
701
  - app/models/phcpress/application_record.rb
702
- - app/models/phcpress/articles.rb
703
- - app/models/phcpress/articles/post.rb
702
+ - app/models/phcpress/article.rb
703
+ - app/models/phcpress/article/post.rb
704
+ - app/models/phcpress/category_versions.rb
704
705
  - app/models/phcpress/frontend.rb
705
706
  - app/models/phcpress/frontend/article.rb
706
707
  - app/models/phcpress/modules.rb
707
708
  - app/models/phcpress/modules/category.rb
708
709
  - app/models/phcpress/modules/connection.rb
710
+ - app/models/phcpress/post_versions.rb
709
711
  - app/uploaders/phcpress/pstimage_uploader.rb
710
712
  - app/views/layouts/components/backend/footer/_footer.html.erb
711
713
  - app/views/layouts/components/backend/navigation/_navigation.html.erb
@@ -715,11 +717,11 @@ files:
715
717
  - app/views/layouts/phcpress/frontend.html.erb
716
718
  - app/views/phcpress/api/v1/categories/index.json.rabl
717
719
  - app/views/phcpress/api/v1/posts/index.json.rabl
718
- - app/views/phcpress/articles/posts/_form.html.erb
719
- - app/views/phcpress/articles/posts/edit.html.erb
720
- - app/views/phcpress/articles/posts/index.html.erb
721
- - app/views/phcpress/articles/posts/new.html.erb
722
- - app/views/phcpress/articles/posts/show.html.erb
720
+ - app/views/phcpress/article/posts/_form.html.erb
721
+ - app/views/phcpress/article/posts/edit.html.erb
722
+ - app/views/phcpress/article/posts/index.html.erb
723
+ - app/views/phcpress/article/posts/new.html.erb
724
+ - app/views/phcpress/article/posts/show.html.erb
723
725
  - app/views/phcpress/frontend/articles/index.html.erb
724
726
  - app/views/phcpress/frontend/articles/show.html.erb
725
727
  - app/views/phcpress/modules/categories/_form.html.erb
@@ -733,12 +735,16 @@ files:
733
735
  - app/views/phcpress/modules/connections/new.html.erb
734
736
  - app/views/phcpress/modules/connections/show.html.erb
735
737
  - config/initializers/friendly_id.rb
738
+ - config/initializers/locale.rb
739
+ - config/initializers/paper_trail.rb
736
740
  - config/routes.rb
737
741
  - config/tinymce.yml
738
742
  - db/migrate/20160716182848_create_phcpress_modules_categories.rb
739
- - db/migrate/20160720181307_create_phcpress_articles_posts.rb
743
+ - db/migrate/20160720181307_create_phcpress_article_posts.rb
740
744
  - db/migrate/20160720235314_create_phcpress_modules_connections.rb
741
- - db/migrate/20170509180858_create_friendly_id_slugs.rb
745
+ - db/migrate/20170509002355_create_phcpress_friendly_id_slugs.rb
746
+ - db/migrate/20170517064030_create_phcpress_post_versions.rb
747
+ - db/migrate/20170517064427_create_phcpress_category_versions.rb
742
748
  - lib/phcpress.rb
743
749
  - lib/phcpress/engine.rb
744
750
  - lib/phcpress/version.rb
@@ -1,67 +0,0 @@
1
- require_dependency "phcpress/application_controller"
2
-
3
- module Phcpress
4
- class Articles::PostsController < ApplicationController
5
-
6
- # Filters & Security
7
- before_action :set_articles_post, only: [:show, :edit, :update, :destroy]
8
-
9
- # Article Index
10
- def index
11
- @articles_posts = Articles::Post.all
12
- end
13
-
14
- # Article Show
15
- def show
16
- end
17
-
18
- # Article New
19
- def new
20
- @articles_post = Articles::Post.new
21
- end
22
-
23
- # Article Edit
24
- def edit
25
- end
26
-
27
- # POST
28
- def create
29
- @articles_post = Articles::Post.new(articles_post_params)
30
- if @articles_post.save
31
- @articles_post.connections.build
32
- redirect_to articles_posts_url, notice: 'Post was successfully created.'
33
- else
34
- render :new
35
- end
36
- end
37
-
38
- # PATCH/PUT
39
- def update
40
- if @articles_post.update(articles_post_params)
41
- @articles_post.connections.build
42
- redirect_to articles_posts_url, notice: 'Post was successfully updated.'
43
- else
44
- render :edit
45
- end
46
- end
47
-
48
- # DELETE
49
- def destroy
50
- @articles_post.destroy
51
- redirect_to articles_posts_url, notice: 'Post was successfully destroyed.'
52
- end
53
-
54
- private
55
-
56
- # Common Callbacks
57
- def set_articles_post
58
- @articles_post = Articles::Post.find(params[:id])
59
- end
60
-
61
- # Params Whitelist
62
- def articles_post_params
63
- params.require(:articles_post).permit(:psttitle, :psttext, :pststatus, :pstimage, :remove_pstimage, category_ids: [])
64
- end
65
-
66
- end
67
- end
@@ -1,30 +0,0 @@
1
- module Phcpress
2
- class Articles::Post < ApplicationRecord
3
-
4
- # Image Upload Initialize
5
- mount_uploader :pstimage, Phcpress::PstimageUploader
6
-
7
- # Clean URL Initialize
8
- extend FriendlyId
9
-
10
- # Paper_tail Initialize
11
- has_paper_trail
12
-
13
- # Model Relationships
14
- has_many :connections, class_name: 'Phcpress::Modules::Connection', dependent: :destroy
15
- has_many :categories, class_name: 'Phcpress::Modules::Category', :through => :connections
16
-
17
- # Validation for Form Fields
18
- validates :psttitle,
19
- presence: true,
20
- length: { minimum: 3 }
21
-
22
- validates :psttext,
23
- presence: true,
24
- length: { minimum: 3 }
25
-
26
- validates :pststatus,
27
- presence: true
28
-
29
- end
30
- end
@@ -1,15 +0,0 @@
1
- class CreateFriendlyIdSlugs < ActiveRecord::Migration
2
- def change
3
- create_table :friendly_id_slugs do |t|
4
- t.string :slug, :null => false
5
- t.integer :sluggable_id, :null => false
6
- t.string :sluggable_type, :limit => 50
7
- t.string :scope
8
- t.datetime :created_at
9
- end
10
- add_index :friendly_id_slugs, :sluggable_id
11
- add_index :friendly_id_slugs, [:slug, :sluggable_type], length: { slug: 140, sluggable_type: 50 }
12
- add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], length: { slug: 70, sluggable_type: 50, scope: 70 }, unique: true
13
- add_index :friendly_id_slugs, :sluggable_type
14
- end
15
- end