Skip to content

Instantly share code, notes, and snippets.

@znz
Last active December 23, 2015 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save znz/6603471 to your computer and use it in GitHub Desktop.
Save znz/6603471 to your computer and use it in GitHub Desktop.
devise 3.0.3 と devise 3.1.0 で自動生成されるファイルの差分
Gems included by the bundle:
* actionmailer (3.2.14)
* actionpack (3.2.14)
* activemodel (3.2.14)
* activerecord (3.2.14)
* activeresource (3.2.14)
* activesupport (3.2.14)
* arel (3.0.2)
* bcrypt-ruby (3.1.2)
* builder (3.0.4)
* bundler (1.3.5)
* coffee-rails (3.2.2)
* coffee-script (2.2.0)
* coffee-script-source (1.6.3)
* devise (3.0.3)
* erubis (2.7.0)
* execjs (2.0.1)
* hike (1.2.3)
* i18n (0.6.5)
* journey (1.0.4)
* jquery-rails (3.0.4)
* json (1.8.0)
* mail (2.5.4)
* mime-types (1.25)
* multi_json (1.8.0)
* orm_adapter (0.4.0)
* polyglot (0.3.3)
* rack (1.4.5)
* rack-cache (1.2)
* rack-ssl (1.3.3)
* rack-test (0.6.2)
* rails (3.2.14)
* railties (3.2.14)
* rake (10.1.0)
* rdoc (3.12.2)
* sass (3.2.10)
* sass-rails (3.2.6)
* sprockets (2.2.2)
* sqlite3 (1.3.8)
* thor (0.18.1)
* tilt (1.4.1)
* treetop (1.4.15)
* tzinfo (0.3.37)
* uglifier (2.2.1)
* warden (1.2.3)
Gems included by the bundle:
* actionmailer (3.2.14)
* actionpack (3.2.14)
* activemodel (3.2.14)
* activerecord (3.2.14)
* activeresource (3.2.14)
* activesupport (3.2.14)
* arel (3.0.2)
* atomic (1.1.14)
* bcrypt-ruby (3.1.2)
* builder (3.0.4)
* bundler (1.3.5)
* coffee-rails (3.2.2)
* coffee-script (2.2.0)
* coffee-script-source (1.6.3)
* devise (3.1.0)
* erubis (2.7.0)
* execjs (2.0.1)
* hike (1.2.3)
* i18n (0.6.5)
* journey (1.0.4)
* jquery-rails (3.0.4)
* json (1.8.0)
* mail (2.5.4)
* mime-types (1.25)
* multi_json (1.8.0)
* orm_adapter (0.4.0)
* polyglot (0.3.3)
* rack (1.4.5)
* rack-cache (1.2)
* rack-ssl (1.3.3)
* rack-test (0.6.2)
* rails (3.2.14)
* railties (3.2.14)
* rake (10.1.0)
* rdoc (3.12.2)
* sass (3.2.10)
* sass-rails (3.2.6)
* sprockets (2.2.2)
* sqlite3 (1.3.8)
* thor (0.18.1)
* thread_safe (0.1.3)
* tilt (1.4.1)
* treetop (1.4.15)
* tzinfo (0.3.37)
* uglifier (2.2.1)
* warden (1.2.3)
diff -u devise30/db/migrate/20130918020528_devise_create_users.rb devise31/db/migrate/20130918020537_devise_create_users.rb
--- devise30/db/migrate/20130918020528_devise_create_users.rb 2013-09-18 11:05:28.000000000 +0900
+++ devise31/db/migrate/20130918020537_devise_create_users.rb 2013-09-18 11:05:37.000000000 +0900
@@ -13,7 +13,7 @@
t.datetime :remember_created_at
## Trackable
- t.integer :sign_in_count, :default => 0
+ t.integer :sign_in_count, :default => 0, :null => false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
@@ -26,13 +26,10 @@
# t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
- # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
+ # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
- ## Token authenticatable
- # t.string :authentication_token
-
t.timestamps
end
@@ -41,6 +38,5 @@
add_index :users, :reset_password_token, :unique => true
# add_index :users, :confirmation_token, :unique => true
# add_index :users, :unlock_token, :unique => true
- # add_index :users, :authentication_token, :unique => true
end
end
diff -u =(tr '"' "'" < devise30/config/initializers/devise.rb) =(tr '"' "'" < devise31/config/initializers/devise.rb)
--- /tmp/zsh6zI5X7 2013-09-18 11:02:42.000000000 +0900
+++ /tmp/zshYypaGP 2013-09-18 11:02:42.000000000 +0900
@@ -1,9 +1,15 @@
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
+ # The secret key used by Devise. Devise uses this key to generate
+ # random tokens. Changing this key will render invalid all existing
+ # confirmation, reset password and unlock tokens in the database.
+ config.secret_key = '938fb3fd19c820347191d4c6aa83bb7792c2b4cf21512e9b169c997a881363778302cee54f721ac6d32c203be7883dd95fb3840aa6fcd13420bcaeb614984a31'
+
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
- # note that it will be overwritten if you use your own mailer class with default 'from' parameter.
+ # note that it will be overwritten if you use your own mailer class
+ # with default 'from' parameter.
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
# Configure the class responsible to send e-mails.
@@ -92,7 +98,7 @@
config.stretches = Rails.env.test? ? 1 : 10
# Setup a pepper to generate the encrypted password.
- # config.pepper = '78b9e8ca5af14b9056027f4bbabe8e73b18ec2a2b0055ca3a282de261a7a8ad7cc25956162e63b987b7d7af2b2fc1173e600021a6963108e701be30415bc6262'
+ # config.pepper = 'de7ffe01a0f79c8bce1f397c761d1727deea30683d75e3e2f0f0a8b359511d070ee22ad5f6c9bd849adf701c45882b8218c3082c153ced1e8e3a67d9d107f854'
# ==> Configuration for :confirmable
# A period that the user is allowed to access the website even without
diff -u devise30/config/initializers/devise.rb devise31/config/initializers/devise.rb
--- devise30/config/initializers/devise.rb 2013-09-18 10:53:26.000000000 +0900
+++ devise31/config/initializers/devise.rb 2013-09-18 10:53:34.000000000 +0900
@@ -1,13 +1,19 @@
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
+ # The secret key used by Devise. Devise uses this key to generate
+ # random tokens. Changing this key will render invalid all existing
+ # confirmation, reset password and unlock tokens in the database.
+ config.secret_key = '938fb3fd19c820347191d4c6aa83bb7792c2b4cf21512e9b169c997a881363778302cee54f721ac6d32c203be7883dd95fb3840aa6fcd13420bcaeb614984a31'
+
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
- # note that it will be overwritten if you use your own mailer class with default "from" parameter.
- config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
+ # note that it will be overwritten if you use your own mailer class
+ # with default "from" parameter.
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
# Configure the class responsible to send e-mails.
- # config.mailer = "Devise::Mailer"
+ # config.mailer = 'Devise::Mailer'
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and
@@ -61,8 +67,8 @@
# If http headers should be returned for AJAX requests. True by default.
# config.http_authenticatable_on_xhr = true
- # The realm used in Http Basic Authentication. "Application" by default.
- # config.http_authentication_realm = "Application"
+ # The realm used in Http Basic Authentication. 'Application' by default.
+ # config.http_authentication_realm = 'Application'
# It will change confirmation, password recovery and other workflows
# to behave the same regardless if the e-mail provided was right or wrong.
@@ -92,7 +98,7 @@
config.stretches = Rails.env.test? ? 1 : 10
# Setup a pepper to generate the encrypted password.
- # config.pepper = "78b9e8ca5af14b9056027f4bbabe8e73b18ec2a2b0055ca3a282de261a7a8ad7cc25956162e63b987b7d7af2b2fc1173e600021a6963108e701be30415bc6262"
+ # config.pepper = 'de7ffe01a0f79c8bce1f397c761d1727deea30683d75e3e2f0f0a8b359511d070ee22ad5f6c9bd849adf701c45882b8218c3082c153ced1e8e3a67d9d107f854'
# ==> Configuration for :confirmable
# A period that the user is allowed to access the website even without
@@ -217,7 +223,7 @@
# should add them to the navigational formats lists.
#
# The "*/*" below is required to match Internet Explorer requests.
- # config.navigational_formats = ["*/*", :html]
+ # config.navigational_formats = ['*/*', :html]
# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :delete
@@ -241,12 +247,12 @@
# is mountable, there are some extra configurations to be taken into account.
# The following options are available, assuming the engine is mounted as:
#
- # mount MyEngine, at: "/my_engine"
+ # mount MyEngine, at: '/my_engine'
#
# The router that invoked `devise_for`, in the example above, would be:
# config.router_name = :my_engine
#
# When using omniauth, Devise cannot automatically set Omniauth path,
# so you need to do it manually. For the users scope, it would be:
- # config.omniauth_path_prefix = "/my_engine/users/auth"
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
end
diff -u devise30/config/locales/devise.en.yml devise31/config/locales/devise.en.yml
--- devise30/config/locales/devise.en.yml 2013-09-18 10:53:26.000000000 +0900
+++ devise31/config/locales/devise.en.yml 2013-09-18 10:53:34.000000000 +0900
@@ -3,17 +3,18 @@
en:
devise:
confirmations:
- confirmed: "Your account was successfully confirmed. You are now signed in."
+ confirmed: "Your account was successfully confirmed. Please sign in."
+ confirmed_and_signed_in: "Your account was successfully confirmed. You are now signed in."
send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
failure:
already_authenticated: "You are already signed in."
- inactive: "Your account was not activated yet."
+ inactive: "Your account is not activated yet."
invalid: "Invalid email or password."
invalid_token: "Invalid authentication token."
locked: "Your account is locked."
not_found_in_database: "Invalid email or password."
- timeout: "Your session expired, please sign in again to continue."
+ timeout: "Your session expired. Please sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You have to confirm your account before continuing."
mailer:
diff -u devise30/app/models/user.rb devise31/app/models/user.rb
--- devise30/app/models/user.rb 2013-09-18 11:05:28.000000000 +0900
+++ devise31/app/models/user.rb 2013-09-18 11:05:37.000000000 +0900
@@ -1,7 +1,6 @@
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
- # :token_authenticatable, :confirmable,
- # :lockable, :timeoutable and :omniauthable
+ # :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
diff -urN devise30/app/views devise31/app/views
diff -urN devise30/app/views/devise/mailer/confirmation_instructions.html.erb devise31/app/views/devise/mailer/confirmation_instructions.html.erb
--- devise30/app/views/devise/mailer/confirmation_instructions.html.erb 2013-09-18 11:07:30.000000000 +0900
+++ devise31/app/views/devise/mailer/confirmation_instructions.html.erb 2013-09-18 11:07:38.000000000 +0900
@@ -2,4 +2,4 @@
<p>You can confirm your account email through the link below:</p>
-<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
+<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %></p>
diff -urN devise30/app/views/devise/mailer/reset_password_instructions.html.erb devise31/app/views/devise/mailer/reset_password_instructions.html.erb
--- devise30/app/views/devise/mailer/reset_password_instructions.html.erb 2013-09-18 11:07:30.000000000 +0900
+++ devise31/app/views/devise/mailer/reset_password_instructions.html.erb 2013-09-18 11:07:38.000000000 +0900
@@ -2,7 +2,7 @@
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
-<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
+<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
diff -urN devise30/app/views/devise/mailer/unlock_instructions.html.erb devise31/app/views/devise/mailer/unlock_instructions.html.erb
--- devise30/app/views/devise/mailer/unlock_instructions.html.erb 2013-09-18 11:07:30.000000000 +0900
+++ devise31/app/views/devise/mailer/unlock_instructions.html.erb 2013-09-18 11:07:38.000000000 +0900
@@ -4,4 +4,4 @@
<p>Click the link below to unlock your account:</p>
-<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
+<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %></p>
diff -urN devise30/app/views/devise/shared/_links.erb devise31/app/views/devise/shared/_links.erb
--- devise30/app/views/devise/shared/_links.erb 2013-09-18 11:07:30.000000000 +0900
+++ devise31/app/views/devise/shared/_links.erb 2013-09-18 11:07:38.000000000 +0900
@@ -6,7 +6,7 @@
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<% end -%>
-<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
+<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
<% end -%>
@@ -22,4 +22,4 @@
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
-<% end -%>
\ No newline at end of file
+<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment