blogo 0.0.2 → 0.0.3
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 +4 -4
- data/app/controllers/blogo/admin/base_controller.rb +1 -1
- data/app/controllers/blogo/admin/sessions_controller.rb +2 -2
- data/db/migrate/20140218134508_create_blogo_users.rb +3 -3
- data/db/migrate/20140218134512_create_blogo_tags.rb +3 -3
- data/db/migrate/20140218134550_create_blogo_posts.rb +10 -5
- data/db/migrate/20140218134620_create_blogo_taggings.rb +11 -3
- data/lib/blogo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e8aa0478a935728f8e374637c05bac7d7dbcc36
|
4
|
+
data.tar.gz: 5064a990c1ad212586634b8cb161250c7d51a834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31920c856aa217328156539a312bcc8ab8be7370ca0ff17279a3df557a46757448fb53d867799eb57201c69de2534e46b0d0326052d2910960813969bb151296
|
7
|
+
data.tar.gz: 3ea88bd62119e88c227c104931875256d01ee134830b59097885b850d05d10fb53cb616330fc11827be22d83a2a034d81ef0d9b36b6f9cb2320007f2a648ea48
|
@@ -9,7 +9,7 @@ module Blogo::Admin
|
|
9
9
|
user = Blogo::User.find_by_email(params[:email])
|
10
10
|
if user && user.authenticate(params[:password])
|
11
11
|
session[:blogo_user_id] = user.id
|
12
|
-
redirect_to
|
12
|
+
redirect_to blogo_admin_url, notice: "You have logged in"
|
13
13
|
else
|
14
14
|
flash.now.alert = "Incorrect email or password"
|
15
15
|
render "new"
|
@@ -18,7 +18,7 @@ module Blogo::Admin
|
|
18
18
|
|
19
19
|
def destroy
|
20
20
|
session[:blogo_user_id] = nil
|
21
|
-
redirect_to
|
21
|
+
redirect_to blogo_admin_url, notice: "You have logged out"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateBlogoUsers < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
|
3
|
+
users_table = "#{Blogo.table_name_prefix}users"
|
4
4
|
|
5
|
-
create_table(
|
5
|
+
create_table(users_table) do |t|
|
6
6
|
t.string :name , null: false
|
7
7
|
t.string :email , null: false
|
8
8
|
t.string :password_digest, null: false
|
@@ -10,6 +10,6 @@ class CreateBlogoUsers < ActiveRecord::Migration
|
|
10
10
|
t.timestamps
|
11
11
|
end
|
12
12
|
|
13
|
-
add_index
|
13
|
+
add_index users_table, :email, unique: true
|
14
14
|
end
|
15
15
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
class CreateBlogoTags < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
|
3
|
+
tags_table = "#{Blogo.table_name_prefix}tags"
|
4
4
|
|
5
|
-
create_table(
|
5
|
+
create_table(tags_table) do |t|
|
6
6
|
t.string :name, null: false
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
10
|
|
11
|
-
add_index
|
11
|
+
add_index tags_table, :name, unique: true
|
12
12
|
end
|
13
13
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateBlogoPosts < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
|
3
|
+
posts_table = "#{Blogo.table_name_prefix}posts"
|
4
4
|
|
5
|
-
create_table(
|
5
|
+
create_table(posts_table) do |t|
|
6
6
|
t.integer :user_id , null: false
|
7
7
|
t.string :permalink , null: false
|
8
8
|
t.string :title , null: false
|
@@ -22,8 +22,13 @@ class CreateBlogoPosts < ActiveRecord::Migration
|
|
22
22
|
t.timestamps
|
23
23
|
end
|
24
24
|
|
25
|
-
add_index
|
26
|
-
add_index
|
27
|
-
add_index
|
25
|
+
add_index posts_table, :user_id
|
26
|
+
add_index posts_table, :permalink, unique: true
|
27
|
+
add_index posts_table, :published_at
|
28
|
+
|
29
|
+
if defined?(Foreigner)
|
30
|
+
users_table = "#{Blogo.table_name_prefix}users"
|
31
|
+
add_foreign_key posts_table, users_table, column: :user_id
|
32
|
+
end
|
28
33
|
end
|
29
34
|
end
|
@@ -1,12 +1,20 @@
|
|
1
1
|
class CreateBlogoTaggings < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
|
3
|
+
taggings_table = "#{Blogo.table_name_prefix}taggings"
|
4
4
|
|
5
|
-
create_table(
|
5
|
+
create_table(taggings_table) do |t|
|
6
6
|
t.integer :post_id, null: false
|
7
7
|
t.integer :tag_id , null: false
|
8
8
|
end
|
9
9
|
|
10
|
-
add_index
|
10
|
+
add_index taggings_table, [:tag_id, :post_id], unique: true
|
11
|
+
|
12
|
+
if defined?(Foreigner)
|
13
|
+
tags_table = "#{Blogo.table_name_prefix}tags"
|
14
|
+
posts_table = "#{Blogo.table_name_prefix}posts"
|
15
|
+
|
16
|
+
add_foreign_key taggings_table, tags_table , column: :tag_id
|
17
|
+
add_foreign_key taggings_table, posts_table, column: :post_id
|
18
|
+
end
|
11
19
|
end
|
12
20
|
end
|
data/lib/blogo/version.rb
CHANGED