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: 9edb2d59ecf23e33b00268e92b5bc16a7b1f4dcf
4
- data.tar.gz: ae237f9a91e52a9382a0417cad0b4c56ffdb32b3
3
+ metadata.gz: 342dc584a9e265365ef9429611f7f3c96929a65e
4
+ data.tar.gz: a8c3de60e803ecb5db700b1eb123df12bb2d6437
5
5
  SHA512:
6
- metadata.gz: ebb83022d112f0264a95b67f4bfd09eca88dee6148d607d284bd4d911a29a48fe1d6d2b8336a8a25bf3b5d27ff5be08c9a1682490d31cbf118cf2120a6b5cad3
7
- data.tar.gz: 84c11cdd3bfc8b25e41eeb33b1c691f18cc9ab799ff438478deddb82de294c371ae039dcd4a64fded9d6458528a947c564d5a5f304ce286a915143b91e824e01
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 += "\n # For Tapp\n"
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 current_user.present? %>
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 ) %>
@@ -1,7 +1,7 @@
1
1
  module Minimum
2
2
  module Omniauth
3
3
  module Scaffold
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimum-omniauth-scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - shu0115