minimum-omniauth-scaffold 0.1.3 → 0.1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 342dc584a9e265365ef9429611f7f3c96929a65e
|
4
|
+
data.tar.gz: a8c3de60e803ecb5db700b1eb123df12bb2d6437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c96ab22403702d67e0735771ed2994f824f1b3f12c424cdb86b646588e2bbf8cfeb7358871fac1fcb021f023b16d0d45ee38e48e649ad427ea2a17ef622ef364
|
7
|
+
data.tar.gz: 03c664e9aedca10ee739fb290b0e80a0fe4b785678fef5a18624f1b4a2b76e56ac426620c1e2fd83a54c80e0198f6c005984350e4d6b34f035f635e3e681b1b1
|
@@ -42,9 +42,9 @@ module Minimum
|
|
42
42
|
# content += " config.active_record.default_timezone = :local\n"
|
43
43
|
insert_into_file( "config/application.rb", content.force_encoding('ASCII-8BIT'), after: "# config.time_zone = 'Central Time (US & Canada)'\n" )
|
44
44
|
insert_into_file( "config/application.rb", " config.i18n.default_locale = :ja\n", after: "# config.i18n.default_locale = :de\n" )
|
45
|
-
content = " # For Heroku\n"
|
46
|
-
content += " config.assets.initialize_on_precompile = false\n"
|
47
|
-
content
|
45
|
+
# content = " # For Heroku\n"
|
46
|
+
# content += " config.assets.initialize_on_precompile = false\n"
|
47
|
+
content = " # For Tapp\n"
|
48
48
|
content += " Tapp.config.default_printer = :awesome_print\n"
|
49
49
|
content += "\n"
|
50
50
|
insert_into_file( "config/application.rb", content.force_encoding('ASCII-8BIT'), after: "class Application < Rails::Application\n" )
|
@@ -7,8 +7,7 @@
|
|
7
7
|
def authorize
|
8
8
|
# セッション/トップコントローラ以外で
|
9
9
|
if params[:controller] != "sessions" and params[:controller] != "top"
|
10
|
-
|
11
|
-
if current_user.blank?
|
10
|
+
unless user_signed_in?
|
12
11
|
# リクエストURL保管
|
13
12
|
session[:request_url] = request.url
|
14
13
|
|
@@ -28,3 +27,9 @@
|
|
28
27
|
@current_user ||= User.where( id: session[:user_id] ).first
|
29
28
|
end
|
30
29
|
helper_method :current_user
|
30
|
+
|
31
|
+
# ユーザ登録チェック
|
32
|
+
def user_signed_in?
|
33
|
+
User.where( id: session[:user_id] ).exists?
|
34
|
+
end
|
35
|
+
helper_method :user_signed_in?
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= link_to Settings.app_name, :root %>
|
2
2
|
|
3
|
-
<% if
|
3
|
+
<% if user_signed_in? %>
|
4
4
|
<%# ログイン済み %>
|
5
5
|
<%= render partial: '/layouts/user_icon', locals: { user: current_user, size: "18x18", klass: "margin_minus2" } %>
|
6
6
|
<%= link_to( "Top", root_path ) %>
|