Skip to content

Commit f50bfba

Browse files
authored
Rename sessions generator to authentication generator (rails#52435)
Sessions is only one part of the equation. We also have users. And will have other elements too.
1 parent 9c8716a commit f50bfba

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Description:
2+
Generates a basic authentication system with users and sessions.
3+
4+
Example:
5+
`bin/rails generate authentication`
6+

railties/lib/rails/generators/rails/sessions/sessions_generator.rb renamed to railties/lib/rails/generators/rails/authentication/authentication_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
module Rails
44
module Generators
5-
class SessionsGenerator < Base # :nodoc:
6-
def create_session_files
5+
class AuthenticationGenerator < Base # :nodoc:
6+
def create_files
77
template "models/session.rb", File.join("app/models/session.rb")
88
template "models/user.rb", File.join("app/models/user.rb")
99
template "models/current.rb", File.join("app/models/current.rb")

railties/lib/rails/generators/rails/sessions/USAGE

Lines changed: 0 additions & 6 deletions
This file was deleted.

railties/test/generators/sessions_generator_test.rb renamed to railties/test/generators/authentication_generator_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
require "generators/generators_test_helper"
44
require "rails/generators/rails/app/app_generator"
5-
require "rails/generators/rails/sessions/sessions_generator"
5+
require "rails/generators/rails/authentication/authentication_generator"
66

7-
class SessionsGeneratorTest < Rails::Generators::TestCase
7+
class AuthenticationGeneratorTest < Rails::Generators::TestCase
88
include GeneratorsTestHelper
99

1010
def setup
@@ -16,11 +16,11 @@ def teardown
1616
Rails.application = Rails.application.instance
1717
end
1818

19-
def test_session_generator
19+
def test_authentication_generator
2020
self.class.tests Rails::Generators::AppGenerator
2121
run_generator([destination_root])
2222

23-
self.class.tests Rails::Generators::SessionsGenerator
23+
self.class.tests Rails::Generators::AuthenticationGenerator
2424
run_generator
2525

2626
assert_file "app/models/user.rb"

0 commit comments

Comments
 (0)