clearance 2.7.2 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +15 -0
  3. data/.github/workflows/dynamic-security.yml +19 -0
  4. data/.github/workflows/tests.yml +7 -7
  5. data/.gitignore +4 -1
  6. data/Appraisals +9 -5
  7. data/CHANGELOG.md +16 -1
  8. data/Gemfile +0 -1
  9. data/Gemfile.lock +130 -97
  10. data/README.md +2 -1
  11. data/Rakefile +4 -7
  12. data/SECURITY.md +12 -8
  13. data/app/views/sessions/_form.html.erb +3 -1
  14. data/bin/setup +2 -2
  15. data/clearance.gemspec +9 -9
  16. data/config/routes.rb +5 -3
  17. data/gemfiles/rails_7.0.gemfile +4 -1
  18. data/gemfiles/rails_7.1.gemfile +0 -1
  19. data/gemfiles/{rails_6.1.gemfile → rails_7.2.gemfile} +1 -3
  20. data/lib/clearance/back_door.rb +4 -2
  21. data/lib/clearance/configuration.rb +14 -0
  22. data/lib/clearance/version.rb +1 -1
  23. data/spec/clearance/session_spec.rb +2 -2
  24. data/spec/configuration_spec.rb +15 -0
  25. data/spec/dummy/Rakefile +6 -0
  26. data/spec/dummy/app/assets/config/manifest.js +0 -0
  27. data/spec/dummy/config/application.rb +13 -0
  28. data/spec/dummy/config/boot.rb +5 -0
  29. data/spec/dummy/config/environment.rb +5 -0
  30. data/spec/dummy/config/environments/test.rb +31 -0
  31. data/spec/dummy/config.ru +6 -0
  32. data/{db → spec/dummy/db}/migrate/20110111224543_create_clearance_users.rb +3 -2
  33. data/spec/dummy/db/schema.rb +25 -0
  34. data/spec/requests/backdoor_spec.rb +11 -0
  35. data/spec/requests/csrf_rotation_spec.rb +1 -5
  36. data/spec/requests/token_expiration_spec.rb +3 -3
  37. data/spec/routing/clearance_routes_spec.rb +32 -0
  38. data/spec/spec_helper.rb +4 -11
  39. data/spec/support/generator_spec_helpers.rb +11 -0
  40. data/spec/support/html_escape_helper.rb +1 -1
  41. metadata +33 -18
  42. data/db/schema.rb +0 -28
  43. data/spec/dummy/application.rb +0 -30
  44. data/spec/support/cookies.rb +0 -74
  45. /data/spec/{factories.rb → factories/users.rb} +0 -0
@@ -15,8 +15,6 @@ gem "rails-controller-testing"
15
15
  gem "rspec-rails"
16
16
  gem "shoulda-matchers"
17
17
  gem "sqlite3", "~> 1.7"
18
- gem "timecop"
19
- gem "railties", "~> 6.1.0"
20
- gem "net-smtp", require: false
18
+ gem "railties", "~> 7.2.0"
21
19
 
22
20
  gemspec path: "../"
@@ -48,11 +48,13 @@ module Clearance
48
48
 
49
49
  # @api private
50
50
  def sign_in_through_the_back_door(env)
51
- params = Rack::Utils.parse_query(env["QUERY_STRING"])
51
+ params = Rack::Utils.parse_query(env[Rack::QUERY_STRING])
52
52
  user_param = params.delete("as")
53
53
 
54
54
  if user_param.present?
55
- env["QUERY_STRING"] = Rack::Utils.build_query(params)
55
+ query_string = Rack::Utils.build_query(params)
56
+ env[Rack::QUERY_STRING] = query_string
57
+ env[Rack::RACK_REQUEST_QUERY_STRING] = query_string
56
58
  user = find_user(user_param)
57
59
  env[:clearance].sign_in(user)
58
60
  end
@@ -7,6 +7,13 @@ module Clearance
7
7
  # @return [Boolean]
8
8
  attr_writer :allow_sign_up
9
9
 
10
+ # Controls whether the password reset routes are enabled
11
+ # Defaults to `true`. Set to False to disable password reset routes
12
+ # The setting is ignored if routes are disabled.
13
+ # @param [Boolean] value
14
+ # @return [Boolean]
15
+ attr_writer :allow_password_reset
16
+
10
17
  # The domain to use for the clearance remember token cookie.
11
18
  # Defaults to `nil`, which causes the cookie domain to default to the
12
19
  # domain of the request. For more, see
@@ -145,6 +152,7 @@ module Clearance
145
152
 
146
153
  def initialize
147
154
  @allow_sign_up = true
155
+ @allow_password_reset = true
148
156
  @allowed_backdoor_environments = ["test", "ci", "development"]
149
157
  @cookie_domain = nil
150
158
  @cookie_expiration = ->(cookies) { 1.year.from_now.utc }
@@ -195,6 +203,12 @@ module Clearance
195
203
  @allow_sign_up
196
204
  end
197
205
 
206
+ # Are the password reset routes enabled?
207
+ # @return [Boolean]
208
+ def allow_password_reset?
209
+ @allow_password_reset
210
+ end
211
+
198
212
  # Specifies which controller actions are allowed for user resources.
199
213
  # This will be `[:create]` is `allow_sign_up` is true (the default), and
200
214
  # empty otherwise.
@@ -1,3 +1,3 @@
1
1
  module Clearance
2
- VERSION = "2.7.2".freeze
2
+ VERSION = "2.9.0".freeze
3
3
  end
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Clearance::Session do
4
- before { Timecop.freeze }
5
- after { Timecop.return }
4
+ before { freeze_time }
5
+ after { unfreeze_time }
6
6
 
7
7
  let(:session) { Clearance::Session.new(env_without_remember_token) }
8
8
  let(:user) { create(:user) }
@@ -179,6 +179,21 @@ describe Clearance::Configuration do
179
179
  end
180
180
  end
181
181
 
182
+ describe "#allow_password_reset?" do
183
+ context "when allow_password_reset is configured to false" do
184
+ it "returns false" do
185
+ Clearance.configure { |config| config.allow_password_reset = false }
186
+ expect(Clearance.configuration.allow_password_reset?).to eq false
187
+ end
188
+ end
189
+
190
+ context "when allow_sign_up has not been configured" do
191
+ it "returns true" do
192
+ expect(Clearance.configuration.allow_password_reset?).to eq true
193
+ end
194
+ end
195
+ end
196
+
182
197
  describe "#user_actions" do
183
198
  context "when allow_sign_up is configured to false" do
184
199
  it "returns empty array" do
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative "config/application"
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,13 @@
1
+ require_relative "boot"
2
+
3
+ require "rails/all"
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ config.load_defaults Rails::VERSION::STRING.to_f
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
3
+
4
+ require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
5
+ $LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative "application"
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,31 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ config.enable_reloading = false
5
+
6
+ config.eager_load = ENV["CI"].present?
7
+
8
+ config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
9
+
10
+ # Show full error reports and disable caching.
11
+ config.consider_all_requests_local = true
12
+ config.action_controller.perform_caching = false
13
+ config.cache_store = :null_store
14
+
15
+ config.action_dispatch.show_exceptions = :rescuable
16
+
17
+ config.action_controller.allow_forgery_protection = false
18
+
19
+ config.action_mailer.perform_caching = false
20
+ config.action_mailer.delivery_method = :test
21
+
22
+ config.action_mailer.default_url_options = { host: "www.example.com" }
23
+
24
+ config.active_support.deprecation = :stderr
25
+ config.active_support.disallowed_deprecation = :raise
26
+ config.active_support.disallowed_deprecation_warnings = []
27
+
28
+ config.factory_bot.definition_file_paths = [File.expand_path('../../../factories', __dir__)]
29
+
30
+ config.middleware.use Clearance::BackDoor
31
+ end
@@ -0,0 +1,6 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative "config/environment"
4
+
5
+ run Rails.application
6
+ Rails.application.load_server
@@ -1,4 +1,4 @@
1
- class CreateClearanceUsers < ActiveRecord::Migration
1
+ class CreateClearanceUsers < ActiveRecord::Migration[Rails::VERSION::STRING.to_f]
2
2
  def self.up
3
3
  create_table :users do |t|
4
4
  t.timestamps null: false
@@ -9,7 +9,8 @@ class CreateClearanceUsers < ActiveRecord::Migration
9
9
  end
10
10
 
11
11
  add_index :users, :email
12
- add_index :users, :remember_token
12
+ add_index :users, :confirmation_token, unique: true
13
+ add_index :users, :remember_token, unique: true
13
14
  end
14
15
 
15
16
  def self.down
@@ -0,0 +1,25 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 2011_01_11_224543) do
14
+ create_table "users", force: :cascade do |t|
15
+ t.datetime "created_at", null: false
16
+ t.datetime "updated_at", null: false
17
+ t.string "email", null: false
18
+ t.string "encrypted_password", limit: 128, null: false
19
+ t.string "confirmation_token", limit: 128
20
+ t.string "remember_token", limit: 128, null: false
21
+ t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
22
+ t.index ["email"], name: "index_users_on_email"
23
+ t.index ["remember_token"], name: "index_users_on_remember_token", unique: true
24
+ end
25
+ end
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+
3
+ describe "Backdoor Middleware" do
4
+ it "allows signing in using query parameter" do
5
+ user = create(:user)
6
+
7
+ get root_path(as: user.to_param)
8
+
9
+ expect(cookies["remember_token"]).to eq user.remember_token
10
+ end
11
+ end
@@ -16,7 +16,7 @@ describe "CSRF Rotation" do
16
16
  original_token = csrf_token
17
17
 
18
18
  post session_path, params: {
19
- session: session_params(user, "password"),
19
+ authenticity_token: csrf_token, session: { email: user.email, password: "password" }
20
20
  }
21
21
 
22
22
  expect(csrf_token).not_to eq original_token
@@ -28,8 +28,4 @@ describe "CSRF Rotation" do
28
28
  def csrf_token
29
29
  session[:_csrf_token]
30
30
  end
31
-
32
- def session_params(user, password)
33
- { email: user.email, password: password, authenticity_token: csrf_token }
34
- end
35
31
  end
@@ -3,13 +3,13 @@ require "spec_helper"
3
3
  describe "Token expiration" do
4
4
  describe "after signing in" do
5
5
  before do
6
- Timecop.freeze
6
+ freeze_time
7
7
  create_user_and_sign_in
8
8
  @initial_cookies = remember_token_cookies
9
9
  end
10
10
 
11
11
  after do
12
- Timecop.return
12
+ unfreeze_time
13
13
  end
14
14
 
15
15
  it "should have a remember_token cookie with a future expiration" do
@@ -25,7 +25,7 @@ describe "Token expiration" do
25
25
  create_user_and_sign_in
26
26
  @initial_cookies = remember_token_cookies
27
27
 
28
- Timecop.travel(1.minute.from_now) do
28
+ travel_to(1.minute.from_now) do
29
29
  get root_path
30
30
  @followup_cookies = remember_token_cookies
31
31
  end
@@ -62,4 +62,36 @@ describe 'routes for Clearance' do
62
62
  expect(post: 'users').to be_routable
63
63
  end
64
64
  end
65
+
66
+ context 'password reset disabled' do
67
+ around do |example|
68
+ Clearance.configure { |config| config.allow_password_reset = false }
69
+ Rails.application.reload_routes!
70
+ example.run
71
+ Clearance.configuration = Clearance::Configuration.new
72
+ Rails.application.reload_routes!
73
+ end
74
+
75
+ it 'does not route password edit' do
76
+ user = create(:user)
77
+ expect(get: "users/#{user.id}/password/edit").not_to be_routable
78
+ end
79
+
80
+ it 'does not route to clearance/passwords#update' do
81
+ user = create(:user)
82
+ expect(patch: "/users/#{user.id}/password").not_to be_routable
83
+ end
84
+ end
85
+
86
+ context 'reset enabled' do
87
+ it 'does route password edit' do
88
+ user = create(:user)
89
+ expect(get: "users/#{user.id}/password/edit").to be_routable
90
+ end
91
+
92
+ it 'does route to clearance/passwords#update' do
93
+ user = create(:user)
94
+ expect(patch: "/users/#{user.id}/password").to be_routable
95
+ end
96
+ end
65
97
  end
data/spec/spec_helper.rb CHANGED
@@ -1,20 +1,13 @@
1
1
  ENV["RAILS_ENV"] ||= "test"
2
+ require_relative "dummy/config/environment"
2
3
 
3
- require "rails/all"
4
- require "dummy/application"
5
-
6
- require "clearance/rspec"
7
- require "factory_bot_rails"
8
- require "rails-controller-testing"
9
4
  require "rspec/rails"
10
- require "shoulda-matchers"
11
- require "timecop"
12
-
13
- Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
5
+ require "clearance/rspec"
14
6
 
15
- Dummy::Application.initialize!
7
+ Dir[File.expand_path("spec/support/**/*.rb")].each { |f| require f }
16
8
 
17
9
  RSpec.configure do |config|
10
+ config.include ActiveSupport::Testing::TimeHelpers
18
11
  config.include FactoryBot::Syntax::Methods
19
12
  config.infer_spec_type_from_file_location!
20
13
  config.order = :random
@@ -3,6 +3,16 @@ require "ammeter/rspec/generator/matchers.rb"
3
3
  require "ammeter/init"
4
4
 
5
5
  module GeneratorSpecHelpers
6
+ module FileMethods
7
+ def file(path)
8
+ Pathname.new(super)
9
+ end
10
+
11
+ def migration_file(path)
12
+ Pathname.new(super)
13
+ end
14
+ end
15
+
6
16
  TEMPLATE_PATH = File.expand_path("../../app_templates", __FILE__)
7
17
 
8
18
  def provide_existing_routes_file
@@ -36,6 +46,7 @@ end
36
46
 
37
47
  RSpec.configure do |config|
38
48
  config.include GeneratorSpecHelpers
49
+ config.prepend GeneratorSpecHelpers::FileMethods
39
50
 
40
51
  config.before(:example, :generator) do
41
52
  destination File.expand_path("../../../tmp", __FILE__)
@@ -1,6 +1,6 @@
1
1
  module HTMLEscapeHelper
2
2
  def translated_string(key)
3
- if Rails.version >= "7.0"
3
+ if [7.0].include?(Rails::VERSION::STRING.to_f)
4
4
  ERB::Util.html_escape_once(I18n.t(key))
5
5
  else
6
6
  I18n.t(key)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clearance
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Croak
@@ -23,15 +23,19 @@ authors:
23
23
  - Galen Frechette
24
24
  - Josh Steiner
25
25
  - Dorian Marié
26
+ - Sara Jackson
26
27
  autorequire:
27
28
  bindir: bin
28
29
  cert_chain: []
29
- date: 2024-06-28 00:00:00.000000000 Z
30
+ date: 2024-10-29 00:00:00.000000000 Z
30
31
  dependencies:
31
32
  - !ruby/object:Gem::Dependency
32
33
  name: bcrypt
33
34
  requirement: !ruby/object:Gem::Requirement
34
35
  requirements:
36
+ - - "~>"
37
+ - !ruby/object:Gem::Version
38
+ version: '3.1'
35
39
  - - ">="
36
40
  - !ruby/object:Gem::Version
37
41
  version: 3.1.1
@@ -39,6 +43,9 @@ dependencies:
39
43
  prerelease: false
40
44
  version_requirements: !ruby/object:Gem::Requirement
41
45
  requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.1'
42
49
  - - ">="
43
50
  - !ruby/object:Gem::Version
44
51
  version: 3.1.1
@@ -80,56 +87,56 @@ dependencies:
80
87
  name: railties
81
88
  requirement: !ruby/object:Gem::Requirement
82
89
  requirements:
83
- - - ">="
90
+ - - "~>"
84
91
  - !ruby/object:Gem::Version
85
92
  version: '5.0'
86
93
  type: :runtime
87
94
  prerelease: false
88
95
  version_requirements: !ruby/object:Gem::Requirement
89
96
  requirements:
90
- - - ">="
97
+ - - "~>"
91
98
  - !ruby/object:Gem::Version
92
99
  version: '5.0'
93
100
  - !ruby/object:Gem::Dependency
94
101
  name: activemodel
95
102
  requirement: !ruby/object:Gem::Requirement
96
103
  requirements:
97
- - - ">="
104
+ - - "~>"
98
105
  - !ruby/object:Gem::Version
99
106
  version: '5.0'
100
107
  type: :runtime
101
108
  prerelease: false
102
109
  version_requirements: !ruby/object:Gem::Requirement
103
110
  requirements:
104
- - - ">="
111
+ - - "~>"
105
112
  - !ruby/object:Gem::Version
106
113
  version: '5.0'
107
114
  - !ruby/object:Gem::Dependency
108
115
  name: activerecord
109
116
  requirement: !ruby/object:Gem::Requirement
110
117
  requirements:
111
- - - ">="
118
+ - - "~>"
112
119
  - !ruby/object:Gem::Version
113
120
  version: '5.0'
114
121
  type: :runtime
115
122
  prerelease: false
116
123
  version_requirements: !ruby/object:Gem::Requirement
117
124
  requirements:
118
- - - ">="
125
+ - - "~>"
119
126
  - !ruby/object:Gem::Version
120
127
  version: '5.0'
121
128
  - !ruby/object:Gem::Dependency
122
129
  name: actionmailer
123
130
  requirement: !ruby/object:Gem::Requirement
124
131
  requirements:
125
- - - ">="
132
+ - - "~>"
126
133
  - !ruby/object:Gem::Version
127
134
  version: '5.0'
128
135
  type: :runtime
129
136
  prerelease: false
130
137
  version_requirements: !ruby/object:Gem::Requirement
131
138
  requirements:
132
- - - ">="
139
+ - - "~>"
133
140
  - !ruby/object:Gem::Version
134
141
  version: '5.0'
135
142
  description: |2
@@ -146,7 +153,9 @@ extra_rdoc_files:
146
153
  - README.md
147
154
  files:
148
155
  - ".erb-lint.yml"
156
+ - ".github/dependabot.yml"
149
157
  - ".github/workflows/dynamic-readme.yml"
158
+ - ".github/workflows/dynamic-security.yml"
150
159
  - ".github/workflows/tests.yml"
151
160
  - ".gitignore"
152
161
  - ".yardopts"
@@ -182,11 +191,9 @@ files:
182
191
  - clearance.gemspec
183
192
  - config/locales/clearance.en.yml
184
193
  - config/routes.rb
185
- - db/migrate/20110111224543_create_clearance_users.rb
186
- - db/schema.rb
187
- - gemfiles/rails_6.1.gemfile
188
194
  - gemfiles/rails_7.0.gemfile
189
195
  - gemfiles/rails_7.1.gemfile
196
+ - gemfiles/rails_7.2.gemfile
190
197
  - lib/clearance.rb
191
198
  - lib/clearance/authentication.rb
192
199
  - lib/clearance/authorization.rb
@@ -262,14 +269,22 @@ files:
262
269
  - spec/controllers/permissions_controller_spec.rb
263
270
  - spec/controllers/sessions_controller_spec.rb
264
271
  - spec/controllers/users_controller_spec.rb
272
+ - spec/dummy/Rakefile
273
+ - spec/dummy/app/assets/config/manifest.js
265
274
  - spec/dummy/app/controllers/application_controller.rb
266
275
  - spec/dummy/app/models/user.rb
267
276
  - spec/dummy/app/models/user_with_optional_password.rb
268
- - spec/dummy/application.rb
277
+ - spec/dummy/config.ru
278
+ - spec/dummy/config/application.rb
279
+ - spec/dummy/config/boot.rb
269
280
  - spec/dummy/config/database.yml
281
+ - spec/dummy/config/environment.rb
282
+ - spec/dummy/config/environments/test.rb
270
283
  - spec/dummy/config/routes.rb
271
284
  - spec/dummy/db/.keep
272
- - spec/factories.rb
285
+ - spec/dummy/db/migrate/20110111224543_create_clearance_users.rb
286
+ - spec/dummy/db/schema.rb
287
+ - spec/factories/users.rb
273
288
  - spec/generators/clearance/install/install_generator_spec.rb
274
289
  - spec/generators/clearance/routes/routes_generator_spec.rb
275
290
  - spec/generators/clearance/specs/specs_generator_spec.rb
@@ -281,6 +296,7 @@ files:
281
296
  - spec/password_strategies/bcrypt_spec.rb
282
297
  - spec/password_strategies/password_strategies_spec.rb
283
298
  - spec/requests/authentication_cookie_spec.rb
299
+ - spec/requests/backdoor_spec.rb
284
300
  - spec/requests/cookie_options_spec.rb
285
301
  - spec/requests/csrf_rotation_spec.rb
286
302
  - spec/requests/password_maintenance_spec.rb
@@ -288,7 +304,6 @@ files:
288
304
  - spec/routing/clearance_routes_spec.rb
289
305
  - spec/spec_helper.rb
290
306
  - spec/support/clearance.rb
291
- - spec/support/cookies.rb
292
307
  - spec/support/fake_model_with_password_strategy.rb
293
308
  - spec/support/fake_model_without_password_strategy.rb
294
309
  - spec/support/generator_spec_helpers.rb
@@ -308,14 +323,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
308
323
  requirements:
309
324
  - - ">="
310
325
  - !ruby/object:Gem::Version
311
- version: 2.4.0
326
+ version: 3.1.6
312
327
  required_rubygems_version: !ruby/object:Gem::Requirement
313
328
  requirements:
314
329
  - - ">="
315
330
  - !ruby/object:Gem::Version
316
331
  version: '0'
317
332
  requirements: []
318
- rubygems_version: 3.3.7
333
+ rubygems_version: 3.5.16
319
334
  signing_key:
320
335
  specification_version: 4
321
336
  summary: Rails authentication & authorization with email & password.
data/db/schema.rb DELETED
@@ -1,28 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20110111224543) do
15
-
16
- create_table "users", force: true do |t|
17
- t.datetime "created_at", null: false
18
- t.datetime "updated_at", null: false
19
- t.string "email", null: false
20
- t.string "encrypted_password", limit: 128, null: false
21
- t.string "confirmation_token", limit: 128
22
- t.string "remember_token", limit: 128, null: false
23
- end
24
-
25
- add_index "users", ["email"], name: "index_users_on_email"
26
- add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
27
- add_index "users", ["remember_token"], name: "index_users_on_remember_token", unique: true
28
- end
@@ -1,30 +0,0 @@
1
- require "rails/all"
2
-
3
- require "clearance"
4
-
5
- module Dummy
6
- APP_ROOT = File.expand_path("..", __FILE__).freeze
7
-
8
- class Application < Rails::Application
9
- config.action_controller.perform_caching = false
10
- config.action_mailer.default_url_options = { host: "dummy.example.com" }
11
- config.action_mailer.delivery_method = :test
12
- config.active_support.deprecation = :stderr
13
- config.eager_load = false
14
-
15
- config.paths["app/controllers"] << "#{APP_ROOT}/app/controllers"
16
- config.paths["app/models"] << "#{APP_ROOT}/app/models"
17
- config.paths["app/views"] << "#{APP_ROOT}/app/views"
18
- config.paths["config/database"] = "#{APP_ROOT}/config/database.yml"
19
- config.paths["log"] = "tmp/log/development.log"
20
- config.paths.add "config/routes.rb", with: "#{APP_ROOT}/config/routes.rb"
21
-
22
- def require_environment!
23
- initialize!
24
- end
25
-
26
- def initialize!(&block)
27
- super unless @initialized
28
- end
29
- end
30
- end