site_blog 0.9.0 → 0.10.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cab7ac4ecc8185d4c4767188b5ea55b94a80670e2e8b3b7a82eede29cf7e35c0
|
4
|
+
data.tar.gz: 6978b193b7ec06015ce25b6eb1e830004bf5cc8afba4b3c89e4095e2f6d366c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3aa2e2048e05a1ec032d540931686a824a971274c42353be6c2eaf67bc3bbae7394c069bcc3ae8b508d1031c1ea8c1fccf2c6c55694dfcbb0d5a460da7bddde
|
7
|
+
data.tar.gz: 545a4d6b16c671674e1c8b4a808a4434f52fe10a84f325629b1294babb2a53cb5337c63fed6415dba94857056d03b664c5edb42d802c114e133a7750c6756934
|
@@ -4,7 +4,7 @@ module SiteBlog
|
|
4
4
|
|
5
5
|
# GET /tags
|
6
6
|
def index
|
7
|
-
render json: Tag.
|
7
|
+
render json: Tag.archived(false)
|
8
8
|
end
|
9
9
|
|
10
10
|
# GET /tags/1
|
@@ -47,7 +47,7 @@ module SiteBlog
|
|
47
47
|
|
48
48
|
# Only allow a list of trusted parameters through.
|
49
49
|
def tag_params
|
50
|
-
params.require(:tag).permit(:slug, :
|
50
|
+
params.require(:tag).permit(:slug, :archived)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
data/app/models/site_blog/tag.rb
CHANGED
data/config/routes.rb
CHANGED
@@ -2,18 +2,18 @@ class AddArticleAndTag < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :site_blog_tags do |t|
|
4
4
|
t.string :slug
|
5
|
-
t.boolean :archived, null: false, default: false
|
5
|
+
t.boolean :archived, null: false, default: false, index: true
|
6
6
|
t.timestamps
|
7
7
|
end
|
8
8
|
|
9
9
|
create_table :site_blog_articles do |t|
|
10
10
|
t.string :title, null: false
|
11
|
-
t.string :slug, null: false
|
11
|
+
t.string :slug, null: false, unique: true, index: true
|
12
12
|
t.text :html_description, null: false
|
13
13
|
t.text :description, null: false
|
14
14
|
t.string :image, null: false
|
15
15
|
t.integer :view_count, null: false, default: 0
|
16
|
-
t.boolean :archived, null: false, default: false
|
16
|
+
t.boolean :archived, null: false, default: false, index: true
|
17
17
|
t.boolean :active, null: false, default: true
|
18
18
|
t.boolean :main, null: false, default: false
|
19
19
|
t.string :locale, null: false
|
@@ -25,8 +25,5 @@ class AddArticleAndTag < ActiveRecord::Migration[7.0]
|
|
25
25
|
t.belongs_to :tag, foreign_key: { to_table: :site_blog_tags }
|
26
26
|
t.timestamps
|
27
27
|
end
|
28
|
-
|
29
|
-
add_index :site_blog_articles, :slug, unique: true
|
30
|
-
add_index :site_blog_articles, [:slug, :archived]
|
31
28
|
end
|
32
29
|
end
|
data/lib/site_blog/version.rb
CHANGED