fix: Add slug to articles (#5500)

This commit is contained in:
Tejaswini Chile
2022-09-28 00:57:18 +05:30
committed by GitHub
parent 8e5d8fcdaf
commit c1c57fb2cd
7 changed files with 46 additions and 14 deletions

View File

@@ -42,8 +42,8 @@ class Api::V1::Accounts::ArticlesController < Api::V1::Accounts::BaseController
def article_params
params.require(:article).permit(
:title, :content, :description, :position, :category_id, :author_id, :associated_article_id, :status, meta: [:title, :description,
{ tags: [] }]
:title, :slug, :content, :description, :position, :category_id, :author_id, :associated_article_id, :status, meta: [:title, :description,
{ tags: [] }]
)
end

View File

@@ -6,6 +6,7 @@
# content :text
# description :text
# meta :jsonb
# slug :string not null
# status :integer
# title :string
# views :integer
@@ -22,6 +23,7 @@
#
# index_articles_on_associated_article_id (associated_article_id)
# index_articles_on_author_id (author_id)
# index_articles_on_slug (slug)
#
class Article < ApplicationRecord
include PgSearch::Model