17 |
--------------------------------------------------------------------------------
/test/dummy/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
5 | load Gem.bin_path("bundler", "bundle")
6 |
--------------------------------------------------------------------------------
/test/dummy/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | APP_PATH = File.expand_path("../config/application", __dir__)
5 | require_relative "../config/boot"
6 | require "rails/commands"
7 |
--------------------------------------------------------------------------------
/test/dummy/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | require_relative "../config/boot"
5 | require "rake"
6 | Rake.application.run
7 |
--------------------------------------------------------------------------------
/test/dummy/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | require "pathname"
5 | require "fileutils"
6 | include FileUtils
7 |
8 | # path to your application root.
9 | APP_ROOT = Pathname.new File.expand_path("..", __dir__)
10 |
11 | def system!(*args)
12 | system(*args) || abort("\n== Command #{args} failed ==")
13 | end
14 |
15 | chdir APP_ROOT do
16 | # This script is a starting point to setup your application.
17 | # Add necessary setup steps to this file.
18 |
19 | puts "== Installing dependencies =="
20 | system! "gem install bundler --conservative"
21 | system("bundle check") || system!("bundle install")
22 |
23 | # puts "\n== Copying sample files =="
24 | # unless File.exist?('config/database.yml')
25 | # cp 'config/database.yml.sample', 'config/database.yml'
26 | # end
27 |
28 | puts "\n== Preparing database =="
29 | system! "bin/rails db:setup"
30 |
31 | puts "\n== Removing old logs and tempfiles =="
32 | system! "bin/rails log:clear tmp:clear"
33 |
34 | puts "\n== Restarting application server =="
35 | system! "bin/rails restart"
36 | end
37 |
--------------------------------------------------------------------------------
/test/dummy/bin/update:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | require "pathname"
5 | require "fileutils"
6 | include FileUtils
7 |
8 | # path to your application root.
9 | APP_ROOT = Pathname.new File.expand_path("..", __dir__)
10 |
11 | def system!(*args)
12 | system(*args) || abort("\n== Command #{args} failed ==")
13 | end
14 |
15 | chdir APP_ROOT do
16 | # This script is a way to update your development environment automatically.
17 | # Add necessary update steps to this file.
18 |
19 | puts "== Installing dependencies =="
20 | system! "gem install bundler --conservative"
21 | system("bundle check") || system!("bundle install")
22 |
23 | puts "\n== Updating database =="
24 | system! "bin/rails db:migrate"
25 |
26 | puts "\n== Removing old logs and tempfiles =="
27 | system! "bin/rails log:clear tmp:clear"
28 |
29 | puts "\n== Restarting application server =="
30 | system! "bin/rails restart"
31 | end
32 |
--------------------------------------------------------------------------------
/test/dummy/config.ru:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # This file is used by Rack-based servers to start the application.
4 |
5 | require ::File.expand_path("config/environment", __dir__)
6 | run Rails.application
7 |
--------------------------------------------------------------------------------
/test/dummy/config/application.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative "boot"
4 |
5 | require "rails/all"
6 |
7 | # Require the gems listed in Gemfile, including any gems
8 | # you've limited to :test, :development, or :production.
9 | Bundler.require(*Rails.groups)
10 |
11 | module Dummy
12 | class Application < Rails::Application
13 | # Settings in config/environments/* take precedence over those specified here.
14 | # Application configuration should go into files in config/initializers
15 | # -- all .rb files in that directory are automatically loaded.
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/test/dummy/config/boot.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
4 |
5 | require "bundler/setup" # Set up gems listed in the Gemfile.
6 |
--------------------------------------------------------------------------------
/test/dummy/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: async
6 |
7 | production:
8 | adapter: redis
9 | url: redis://localhost:6379/1
10 |
--------------------------------------------------------------------------------
/test/dummy/config/database.yml:
--------------------------------------------------------------------------------
1 | default: &default
2 | adapter: postgresql
3 | timeout: 5000
4 | encoding: utf-8
5 |
6 | development:
7 | <<: *default
8 | database: audit_log_dummy_development
9 |
10 | test:
11 | <<: *default
12 | database: audit_log_dummy_test
13 |
14 | production:
15 | <<: *default
16 | url: <%= ENV['DATABASE_URL'] %>
17 |
--------------------------------------------------------------------------------
/test/dummy/config/environment.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Load the Rails application.
4 | require_relative "application"
5 |
6 | # Initialize the Rails application.
7 | Rails.application.initialize!
8 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # In the development environment your application's code is reloaded on
7 | # every request. This slows down response time but is perfect for development
8 | # since you don't have to restart the web server when you make code changes.
9 | config.cache_classes = false
10 |
11 | # Do not eager load code on boot.
12 | config.eager_load = false
13 |
14 | # Show full error reports.
15 | config.consider_all_requests_local = true
16 |
17 | # Enable/disable caching. By default caching is disabled.
18 | if Rails.root.join("tmp/caching-dev.txt").exist?
19 | config.action_controller.perform_caching = true
20 |
21 | config.cache_store = :memory_store
22 | # config.public_file_server.headers = {
23 | # 'Cache-Control' => 'public, max-age=172800'
24 | # }
25 | else
26 | config.action_controller.perform_caching = false
27 |
28 | config.cache_store = :null_store
29 | end
30 |
31 | # Don't care if the mailer can't send.
32 | config.action_mailer.raise_delivery_errors = false
33 |
34 | # Print deprecation notices to the Rails logger.
35 | config.active_support.deprecation = :log
36 |
37 | # Raise an error on page load if there are pending migrations.
38 | config.active_record.migration_error = :page_load
39 |
40 | # Debug mode disables concatenation and preprocessing of assets.
41 | # This option may cause significant delays in view rendering with a large
42 | # number of complex assets.
43 | config.assets.debug = true
44 |
45 | # Suppress logger output for asset requests.
46 | config.assets.quiet = true
47 |
48 | # Raises error for missing translations
49 | # config.action_view.raise_on_missing_translations = true
50 |
51 | # Use an evented file watcher to asynchronously detect changes in source code,
52 | # routes, locales, etc. This feature depends on the listen gem.
53 | # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54 | end
55 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # Code is not reloaded between requests.
7 | config.cache_classes = true
8 |
9 | # Eager load code on boot. This eager loads most of Rails and
10 | # your application in memory, allowing both threaded web servers
11 | # and those relying on copy on write to perform better.
12 | # Rake tasks automatically ignore this option for performance.
13 | config.eager_load = true
14 |
15 | # Full error reports are disabled and caching is turned on.
16 | config.consider_all_requests_local = false
17 | config.action_controller.perform_caching = true
18 |
19 | # Disable serving static files from the `/public` folder by default since
20 | # Apache or NGINX already handles this.
21 | # config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
22 |
23 | # Compress JavaScripts and CSS.
24 | config.assets.js_compressor = :uglifier
25 | # config.assets.css_compressor = :sass
26 |
27 | # Do not fallback to assets pipeline if a precompiled asset is missed.
28 | config.assets.compile = false
29 |
30 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
31 |
32 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
33 | # config.action_controller.asset_host = 'http://assets.example.com'
34 |
35 | # Specifies the header that your server uses for sending files.
36 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
37 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
38 |
39 | # Mount Action Cable outside main process or domain
40 | # config.action_cable.mount_path = nil
41 | # config.action_cable.url = 'wss://example.com/cable'
42 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
43 |
44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45 | # config.force_ssl = true
46 |
47 | # Use the lowest log level to ensure availability of diagnostic information
48 | # when problems arise.
49 | config.log_level = :debug
50 |
51 | # Prepend all log lines with the following tags.
52 | config.log_tags = [:request_id]
53 |
54 | # Use a different cache store in production.
55 | # config.cache_store = :mem_cache_store
56 |
57 | # Use a real queuing backend for Active Job (and separate queues per environment)
58 | # config.active_job.queue_adapter = :resque
59 | # config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
60 |
61 | # Ignore bad email addresses and do not raise email delivery errors.
62 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
63 | # config.action_mailer.raise_delivery_errors = false
64 |
65 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
66 | # the I18n.default_locale when a translation cannot be found).
67 | config.i18n.fallbacks = true
68 |
69 | # Send deprecation notices to registered listeners.
70 | config.active_support.deprecation = :notify
71 |
72 | # Use default logging formatter so that PID and timestamp are not suppressed.
73 | config.log_formatter = ::Logger::Formatter.new
74 |
75 | # Use a different logger for distributed setups.
76 | # require 'syslog/logger'
77 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
78 |
79 | if ENV["RAILS_LOG_TO_STDOUT"].present?
80 | logger = ActiveSupport::Logger.new($stdout)
81 | logger.formatter = config.log_formatter
82 | config.logger = ActiveSupport::TaggedLogging.new(logger)
83 | end
84 |
85 | # Do not dump schema after migrations.
86 | config.active_record.dump_schema_after_migration = false
87 | end
88 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # The test environment is used exclusively to run your application's
7 | # test suite. You never need to work with it otherwise. Remember that
8 | # your test database is "scratch space" for the test suite and is wiped
9 | # and recreated between test runs. Don't rely on the data there!
10 | config.cache_classes = true
11 |
12 | # Do not eager load code on boot. This avoids loading your whole application
13 | # just for the purpose of running a single test. If you are using a tool that
14 | # preloads Rails for running tests, you may have to set it to true.
15 | config.eager_load = false
16 |
17 | # Configure public file server for tests with Cache-Control for performance.
18 | # config.public_file_server.enabled = true
19 | # config.public_file_server.headers = {
20 | # 'Cache-Control' => 'public, max-age=3600'
21 | # }
22 |
23 | # Show full error reports and disable caching.
24 | config.consider_all_requests_local = true
25 | config.action_controller.perform_caching = false
26 |
27 | # Raise exceptions instead of rendering exception templates.
28 | config.action_dispatch.show_exceptions = false
29 |
30 | # Disable request forgery protection in test environment.
31 | config.action_controller.allow_forgery_protection = false
32 |
33 | # Tell Action Mailer not to deliver emails to the real world.
34 | # The :test delivery method accumulates sent emails in the
35 | # ActionMailer::Base.deliveries array.
36 | config.action_mailer.delivery_method = :test
37 |
38 | # Print deprecation notices to the stderr.
39 | config.active_support.deprecation = :stderr
40 |
41 | # Raises error for missing translations
42 | # config.action_view.raise_on_missing_translations = true
43 | end
44 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/application_controller_renderer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # Be sure to restart your server when you modify this file.
3 |
4 | # ApplicationController.renderer.defaults.merge!(
5 | # http_host: 'example.org',
6 | # https: false
7 | # )
8 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Be sure to restart your server when you modify this file.
4 |
5 | # Version of your assets, change this if you want to expire all your assets.
6 | Rails.application.config.assets.version = "1.0"
7 |
8 | # Add additional assets to the asset load path
9 | # Rails.application.config.assets.paths << Emoji.images_path
10 |
11 | # Precompile additional assets.
12 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
13 | # Rails.application.config.assets.precompile += %w( search.js )
14 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/audit-log.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | AuditLog.configure do
4 | # class name of you User model, default: 'User'
5 | # self.user_class = "User"
6 | # current_user method name in your Controller, default: 'current_user'
7 | self.current_user_method = "custom_current_user"
8 | end
9 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # Be sure to restart your server when you modify this file.
3 |
4 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
5 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
6 |
7 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
8 | # Rails.backtrace_cleaner.remove_silencers!
9 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Be sure to restart your server when you modify this file.
4 |
5 | # Specify a serializer for the signed and encrypted cookie jars.
6 | # Valid options are :json, :marshal, and :hybrid.
7 | Rails.application.config.action_dispatch.cookies_serializer = :marshal
8 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/devise.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Use this hook to configure devise mailer, warden hooks and so forth.
4 | # Many of these configuration options can be set straight in your model.
5 | Devise.setup do |config|
6 | # The secret key used by Devise. Devise uses this key to generate
7 | # random tokens. Changing this key will render invalid all existing
8 | # confirmation, reset password and unlock tokens in the database.
9 | # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
10 | # by default. You can change it below and use your own secret key.
11 | config.secret_key = "1c78947326c696c7e3d762125951d64a160b7d84b1033c6b5c172422f222caea04cb5653cdd133d54595ede9563ca96db66fd1ccb0bb0d7bccdb3be499516e5c"
12 |
13 | # ==> Mailer Configuration
14 | # Configure the e-mail address which will be shown in Devise::Mailer,
15 | # note that it will be overwritten if you use your own mailer class
16 | # with default "from" parameter.
17 | config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
18 |
19 | # Configure the class responsible to send e-mails.
20 | # config.mailer = 'Devise::Mailer'
21 |
22 | # ==> ORM configuration
23 | # Load and configure the ORM. Supports :active_record (default) and
24 | # :mongoid (bson_ext recommended) by default. Other ORMs may be
25 | # available as additional gems.
26 | require "devise/orm/active_record"
27 |
28 | # ==> Configuration for any authentication mechanism
29 | # Configure which keys are used when authenticating a user. The default is
30 | # just :email. You can configure it to use [:username, :subdomain], so for
31 | # authenticating a user, both parameters are required. Remember that those
32 | # parameters are used only when authenticating and not when retrieving from
33 | # session. If you need permissions, you should implement that in a before filter.
34 | # You can also supply a hash where the value is a boolean determining whether
35 | # or not authentication should be aborted when the value is not present.
36 | # config.authentication_keys = [:email]
37 |
38 | # Configure parameters from the request object used for authentication. Each entry
39 | # given should be a request method and it will automatically be passed to the
40 | # find_for_authentication method and considered in your model lookup. For instance,
41 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
42 | # The same considerations mentioned for authentication_keys also apply to request_keys.
43 | # config.request_keys = []
44 |
45 | # Configure which authentication keys should be case-insensitive.
46 | # These keys will be downcased upon creating or modifying a user and when used
47 | # to authenticate or find a user. Default is :email.
48 | config.case_insensitive_keys = [:email]
49 |
50 | # Configure which authentication keys should have whitespace stripped.
51 | # These keys will have whitespace before and after removed upon creating or
52 | # modifying a user and when used to authenticate or find a user. Default is :email.
53 | config.strip_whitespace_keys = [:email]
54 |
55 | # Tell if authentication through request.params is enabled. True by default.
56 | # It can be set to an array that will enable params authentication only for the
57 | # given strategies, for example, `config.params_authenticatable = [:database]` will
58 | # enable it only for database (email + password) authentication.
59 | # config.params_authenticatable = true
60 |
61 | # Tell if authentication through HTTP Auth is enabled. False by default.
62 | # It can be set to an array that will enable http authentication only for the
63 | # given strategies, for example, `config.http_authenticatable = [:database]` will
64 | # enable it only for database authentication. The supported strategies are:
65 | # :database = Support basic authentication with authentication key + password
66 | # config.http_authenticatable = false
67 |
68 | # If 401 status code should be returned for AJAX requests. True by default.
69 | # config.http_authenticatable_on_xhr = true
70 |
71 | # The realm used in Http Basic Authentication. 'Application' by default.
72 | # config.http_authentication_realm = 'Application'
73 |
74 | # It will change confirmation, password recovery and other workflows
75 | # to behave the same regardless if the e-mail provided was right or wrong.
76 | # Does not affect registerable.
77 | # config.paranoid = true
78 |
79 | # By default Devise will store the user in session. You can skip storage for
80 | # particular strategies by setting this option.
81 | # Notice that if you are skipping storage for all authentication paths, you
82 | # may want to disable generating routes to Devise's sessions controller by
83 | # passing skip: :sessions to `devise_for` in your config/routes.rb
84 | config.skip_session_storage = [:http_auth]
85 |
86 | # By default, Devise cleans up the CSRF token on authentication to
87 | # avoid CSRF token fixation attacks. This means that, when using AJAX
88 | # requests for sign in and sign up, you need to get a new CSRF token
89 | # from the server. You can disable this option at your own risk.
90 | # config.clean_up_csrf_token_on_authentication = true
91 |
92 | # ==> Configuration for :database_authenticatable
93 | # For bcrypt, this is the cost for hashing the password and defaults to 10. If
94 | # using other encryptors, it sets how many times you want the password re-encrypted.
95 | #
96 | # Limiting the stretches to just one in testing will increase the performance of
97 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
98 | # a value less than 10 in other environments. Note that, for bcrypt (the default
99 | # encryptor), the cost increases exponentially with the number of stretches (e.g.
100 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
101 | config.stretches = Rails.env.test? ? 1 : 10
102 |
103 | # Setup a pepper to generate the encrypted password.
104 | # config.pepper = 'b1a08aa7364dafb0a66452187bfb8a4859aa253e056ec5baaafeb3860d3416975a8145083227249d2585ef15c5b0f47f22d5493cd0d40b0f053849e824c3c7c7'
105 |
106 | # Send a notification email when the user's password is changed
107 | # config.send_password_change_notification = false
108 |
109 | # ==> Configuration for :confirmable
110 | # A period that the user is allowed to access the website even without
111 | # confirming their account. For instance, if set to 2.days, the user will be
112 | # able to access the website for two days without confirming their account,
113 | # access will be blocked just in the third day. Default is 0.days, meaning
114 | # the user cannot access the website without confirming their account.
115 | # config.allow_unconfirmed_access_for = 2.days
116 |
117 | # A period that the user is allowed to confirm their account before their
118 | # token becomes invalid. For example, if set to 3.days, the user can confirm
119 | # their account within 3 days after the mail was sent, but on the fourth day
120 | # their account can't be confirmed with the token any more.
121 | # Default is nil, meaning there is no restriction on how long a user can take
122 | # before confirming their account.
123 | # config.confirm_within = 3.days
124 |
125 | # If true, requires any email changes to be confirmed (exactly the same way as
126 | # initial account confirmation) to be applied. Requires additional unconfirmed_email
127 | # db field (see migrations). Until confirmed, new email is stored in
128 | # unconfirmed_email column, and copied to email column on successful confirmation.
129 | config.reconfirmable = true
130 |
131 | # Defines which key will be used when confirming an account
132 | # config.confirmation_keys = [:email]
133 |
134 | # ==> Configuration for :rememberable
135 | # The time the user will be remembered without asking for credentials again.
136 | # config.remember_for = 2.weeks
137 |
138 | # Invalidates all the remember me tokens when the user signs out.
139 | config.expire_all_remember_me_on_sign_out = true
140 |
141 | # If true, extends the user's remember period when remembered via cookie.
142 | # config.extend_remember_period = false
143 |
144 | # Options to be passed to the created cookie. For instance, you can set
145 | # secure: true in order to force SSL only cookies.
146 | # config.rememberable_options = {}
147 |
148 | # ==> Configuration for :validatable
149 | # Range for password length.
150 | config.password_length = 6..72
151 |
152 | # ==> Configuration for :timeoutable
153 | # The time you want to timeout the user session without activity. After this
154 | # time the user will be asked for credentials again. Default is 30 minutes.
155 | # config.timeout_in = 30.minutes
156 |
157 | # ==> Configuration for :lockable
158 | # Defines which strategy will be used to lock an account.
159 | # :failed_attempts = Locks an account after a number of failed attempts to sign in.
160 | # :none = No lock strategy. You should handle locking by yourself.
161 | # config.lock_strategy = :failed_attempts
162 |
163 | # Defines which key will be used when locking and unlocking an account
164 | # config.unlock_keys = [:email]
165 |
166 | # Defines which strategy will be used to unlock an account.
167 | # :email = Sends an unlock link to the user email
168 | # :time = Re-enables login after a certain amount of time (see :unlock_in below)
169 | # :both = Enables both strategies
170 | # :none = No unlock strategy. You should handle unlocking by yourself.
171 | # config.unlock_strategy = :both
172 |
173 | # Number of authentication tries before locking an account if lock_strategy
174 | # is failed attempts.
175 | # config.maximum_attempts = 20
176 |
177 | # Time interval to unlock the account if :time is enabled as unlock_strategy.
178 | # config.unlock_in = 1.hour
179 |
180 | # Warn on the last attempt before the account is locked.
181 | # config.last_attempt_warning = true
182 |
183 | # ==> Configuration for :recoverable
184 | #
185 | # Defines which key will be used when recovering the password for an account
186 | # config.reset_password_keys = [:email]
187 |
188 | # Time interval you can reset your password with a reset password key.
189 | # Don't put a too small interval or your users won't have the time to
190 | # change their passwords.
191 | config.reset_password_within = 6.hours
192 |
193 | # When set to false, does not sign a user in automatically after their password is
194 | # reset. Defaults to true, so a user is signed in automatically after a reset.
195 | # config.sign_in_after_reset_password = true
196 |
197 | # ==> Configuration for :encryptable
198 | # Allow you to use another encryption algorithm besides bcrypt (default). You can use
199 | # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
200 | # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
201 | # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
202 | # REST_AUTH_SITE_KEY to pepper).
203 | #
204 | # Require the `devise-encryptable` gem when using anything other than bcrypt
205 | # config.encryptor = :sha512
206 |
207 | # ==> Scopes configuration
208 | # Turn scoped views on. Before rendering "sessions/new", it will first check for
209 | # "users/sessions/new". It's turned off by default because it's slower if you
210 | # are using only default views.
211 | # config.scoped_views = false
212 |
213 | # Configure the default scope given to Warden. By default it's the first
214 | # devise role declared in your routes (usually :user).
215 | # config.default_scope = :user
216 |
217 | # Set this configuration to false if you want /users/sign_out to sign out
218 | # only the current scope. By default, Devise signs out all scopes.
219 | # config.sign_out_all_scopes = true
220 |
221 | # ==> Navigation configuration
222 | # Lists the formats that should be treated as navigational. Formats like
223 | # :html, should redirect to the sign in page when the user does not have
224 | # access, but formats like :xml or :json, should return 401.
225 | #
226 | # If you have any extra navigational formats, like :iphone or :mobile, you
227 | # should add them to the navigational formats lists.
228 | #
229 | # The "*/*" below is required to match Internet Explorer requests.
230 | # config.navigational_formats = ['*/*', :html]
231 |
232 | # The default HTTP method used to sign out a resource. Default is :delete.
233 | config.sign_out_via = :delete
234 |
235 | # ==> OmniAuth
236 | # Add a new OmniAuth provider. Check the wiki for more information on setting
237 | # up on your models and hooks.
238 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
239 |
240 | # ==> Warden configuration
241 | # If you want to use other strategies, that are not supported by Devise, or
242 | # change the failure app, you can configure them inside the config.warden block.
243 | #
244 | # config.warden do |manager|
245 | # manager.intercept_401 = false
246 | # manager.default_strategies(scope: :user).unshift :some_external_strategy
247 | # end
248 |
249 | # ==> Mountable engine configurations
250 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine
251 | # is mountable, there are some extra configurations to be taken into account.
252 | # The following options are available, assuming the engine is mounted as:
253 | #
254 | # mount MyEngine, at: '/my_engine'
255 | #
256 | # The router that invoked `devise_for`, in the example above, would be:
257 | # config.router_name = :my_engine
258 | #
259 | # When using OmniAuth, Devise cannot automatically set OmniAuth path,
260 | # so you need to do it manually. For the users scope, it would be:
261 | # config.omniauth_path_prefix = '/my_engine/users/auth'
262 | end
263 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Be sure to restart your server when you modify this file.
4 |
5 | # Configure sensitive parameters which will be filtered from the log file.
6 | Rails.application.config.filter_parameters += [:password]
7 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # Be sure to restart your server when you modify this file.
3 |
4 | # Add new inflection rules using the following format. Inflections
5 | # are locale specific, and you may define rules for as many different
6 | # locales as you wish. All of these examples are active by default:
7 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
8 | # inflect.plural /^(ox)$/i, '\1en'
9 | # inflect.singular /^(ox)en/i, '\1'
10 | # inflect.irregular 'person', 'people'
11 | # inflect.uncountable %w( fish sheep )
12 | # end
13 |
14 | # These inflection rules are supported but not enabled by default:
15 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
16 | # inflect.acronym 'RESTful'
17 | # end
18 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # Be sure to restart your server when you modify this file.
3 |
4 | # Add new mime types for use in respond_to blocks:
5 | # Mime::Type.register "text/richtext", :rtf
6 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Be sure to restart your server when you modify this file.
4 |
5 | Rails.application.config.session_store :cookie_store, key: "_dummy_session"
6 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Be sure to restart your server when you modify this file.
4 |
5 | # This file contains settings for ActionController::ParamsWrapper which
6 | # is enabled by default.
7 |
8 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
9 | ActiveSupport.on_load(:action_controller) do
10 | wrap_parameters format: [:json]
11 | end
12 |
13 | # To enable root element in JSON for ActiveRecord objects.
14 | # ActiveSupport.on_load(:active_record) do
15 | # self.include_root_in_json = true
16 | # end
17 |
--------------------------------------------------------------------------------
/test/dummy/config/locales/devise.en.yml:
--------------------------------------------------------------------------------
1 | # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2 |
3 | en:
4 | devise:
5 | confirmations:
6 | confirmed: "Your email address has been successfully confirmed."
7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9 | failure:
10 | already_authenticated: "You are already signed in."
11 | inactive: "Your account is not activated yet."
12 | invalid: "Invalid %{authentication_keys} or password."
13 | locked: "Your account is locked."
14 | last_attempt: "You have one more attempt before your account is locked."
15 | not_found_in_database: "Invalid %{authentication_keys} or password."
16 | timeout: "Your session expired. Please sign in again to continue."
17 | unauthenticated: "You need to sign in or sign up before continuing."
18 | unconfirmed: "You have to confirm your email address before continuing."
19 | mailer:
20 | confirmation_instructions:
21 | subject: "Confirmation instructions"
22 | reset_password_instructions:
23 | subject: "Reset password instructions"
24 | unlock_instructions:
25 | subject: "Unlock instructions"
26 | password_change:
27 | subject: "Password Changed"
28 | omniauth_callbacks:
29 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
30 | success: "Successfully authenticated from %{kind} account."
31 | passwords:
32 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
33 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
34 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
35 | updated: "Your password has been changed successfully. You are now signed in."
36 | updated_not_active: "Your password has been changed successfully."
37 | registrations:
38 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
39 | signed_up: "Welcome! You have signed up successfully."
40 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
41 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
42 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
43 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
44 | updated: "Your account has been updated successfully."
45 | sessions:
46 | signed_in: "Signed in successfully."
47 | signed_out: "Signed out successfully."
48 | already_signed_out: "Signed out successfully."
49 | unlocks:
50 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
51 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
52 | unlocked: "Your account has been unlocked successfully. Please sign in to continue."
53 | errors:
54 | messages:
55 | already_confirmed: "was already confirmed, please try signing in"
56 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
57 | expired: "has expired, please request a new one"
58 | not_found: "not found"
59 | not_locked: "was not locked"
60 | not_saved:
61 | one: "1 error prohibited this %{resource} from being saved:"
62 | other: "%{count} errors prohibited this %{resource} from being saved:"
63 |
--------------------------------------------------------------------------------
/test/dummy/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | hello: "Hello world"
24 | audit_log:
25 | action:
26 | hello: "Hello1"
27 | home: "Visit Home"
28 |
--------------------------------------------------------------------------------
/test/dummy/config/puma.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Puma can serve each request in a thread from an internal thread pool.
4 | # The `threads` method setting takes two numbers a minimum and maximum.
5 | # Any libraries that use thread pools should be configured to match
6 | # the maximum value specified for Puma. Default is set to 5 threads for minimum
7 | # and maximum, this matches the default thread size of Active Record.
8 | #
9 | threads_count = ENV.fetch("RAILS_MAX_THREADS", 5).to_i
10 | threads threads_count, threads_count
11 |
12 | # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
13 | #
14 | port ENV.fetch("PORT", 3000)
15 |
16 | # Specifies the `environment` that Puma will run in.
17 | #
18 | environment ENV.fetch("RAILS_ENV", "development")
19 |
20 | # Specifies the number of `workers` to boot in clustered mode.
21 | # Workers are forked webserver processes. If using threads and workers together
22 | # the concurrency of the application would be max `threads` * `workers`.
23 | # Workers do not work on JRuby or Windows (both of which do not support
24 | # processes).
25 | #
26 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
27 |
28 | # Use the `preload_app!` method when specifying a `workers` number.
29 | # This directive tells Puma to first boot the application and load code
30 | # before forking the application. This takes advantage of Copy On Write
31 | # process behavior so workers use less memory. If you use this option
32 | # you need to make sure to reconnect any threads in the `on_worker_boot`
33 | # block.
34 | #
35 | # preload_app!
36 |
37 | # The code in the `on_worker_boot` will be called if you are using
38 | # clustered mode by specifying a number of `workers`. After each worker
39 | # process is booted this block will be run, if you are using `preload_app!`
40 | # option you will want to use this block to reconnect to any threads
41 | # or connections that may have been created at application boot, Ruby
42 | # cannot share connections between processes.
43 | #
44 | # on_worker_boot do
45 | # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
46 | # end
47 |
48 | # Allow puma to be restarted by `rails restart` command.
49 | plugin :tmp_restart
50 |
--------------------------------------------------------------------------------
/test/dummy/config/routes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Rails.application.routes.draw do
4 | resources :comments
5 | resources :topics
6 | devise_for :users
7 | mount AuditLog::Engine => "/audit-log"
8 | root to: "welcome#index"
9 | end
10 |
--------------------------------------------------------------------------------
/test/dummy/config/secrets.yml:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rails secret` to generate a secure secret key.
9 |
10 | # Make sure the secrets in this file are kept private
11 | # if you're sharing your code publicly.
12 |
13 | development:
14 | secret_key_base: 5c58b96a81fa832d47ed3f82e4ddb743ffd25ef22559667a77c96518bbb736e1a240fb76b4b68b96a25c885934c236a7ccb1acc5e865fc8c35895faa4ccc4b60
15 |
16 | test:
17 | secret_key_base: 4c766db61f426d511a9087e8c064efd3efb472eeb7f296ab5134c8a93d352ceea75202cda9f75fc001a881204d1629039f688ef3917da6c1c87137713de1286f
18 |
19 | # Do not keep production secrets in the repository,
20 | # instead read values from the environment.
21 | production:
22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23 |
--------------------------------------------------------------------------------
/test/dummy/config/spring.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | %w[
4 | .ruby-version
5 | .rbenv-vars
6 | tmp/restart.txt
7 | tmp/caching-dev.txt
8 | ].each { |path| Spring.watch(path) }
9 |
--------------------------------------------------------------------------------
/test/dummy/db/migrate/20160321143003_devise_create_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class DeviseCreateUsers < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table(:users) do |t|
6 | ## Database authenticatable
7 | t.string :email, null: false, default: ""
8 | t.string :encrypted_password, null: false, default: ""
9 |
10 | ## Recoverable
11 | t.string :reset_password_token
12 | t.datetime :reset_password_sent_at
13 |
14 | ## Rememberable
15 | t.datetime :remember_created_at
16 |
17 | ## Trackable
18 | t.integer :sign_in_count, default: 0, null: false
19 | t.datetime :current_sign_in_at
20 | t.datetime :last_sign_in_at
21 | t.string :current_sign_in_ip
22 | t.string :last_sign_in_ip
23 |
24 | ## Confirmable
25 | # t.string :confirmation_token
26 | # t.datetime :confirmed_at
27 | # t.datetime :confirmation_sent_at
28 | # t.string :unconfirmed_email # Only if using reconfirmable
29 |
30 | ## Lockable
31 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
32 | # t.string :unlock_token # Only if unlock strategy is :email or :both
33 | # t.datetime :locked_at
34 |
35 | t.timestamps null: false
36 | end
37 |
38 | add_index :users, :email, unique: true
39 | add_index :users, :reset_password_token, unique: true
40 | # add_index :users, :confirmation_token, unique: true
41 | # add_index :users, :unlock_token, unique: true
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/test/dummy/db/migrate/20160328070223_create_topics.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateTopics < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :topics do |t|
6 | t.string :title
7 | t.integer :user_id
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/test/dummy/db/migrate/20160328070302_create_comments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateComments < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :comments do |t|
6 | t.integer :topic_id
7 | t.integer :user_id
8 | t.string :body
9 |
10 | t.timestamps
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/test/dummy/db/schema.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # This file is auto-generated from the current state of the database. Instead
4 | # of editing this file, please use the migrations feature of Active Record to
5 | # incrementally modify your database, and then regenerate this schema definition.
6 | #
7 | # This file is the source Rails uses to define your schema when running `bin/rails
8 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
9 | # be faster and is potentially less error prone than running all of your
10 | # migrations from scratch. Old migrations may fail to apply correctly if those
11 | # migrations use external dependencies or application code.
12 | #
13 | # It's strongly recommended that you check this file into your version control system.
14 |
15 | ActiveRecord::Schema.define(version: 20_190_527_035_005) do
16 | # These are extensions that must be enabled in order to support this database
17 | enable_extension "plpgsql"
18 |
19 | create_table "audit_logs", force: :cascade do |t|
20 | t.string "action", null: false
21 | t.bigint "user_id"
22 | t.bigint "record_id"
23 | t.string "record_type"
24 | t.text "payload"
25 | t.text "request"
26 | t.datetime "created_at"
27 | t.datetime "updated_at"
28 | t.index ["action"], name: "index_audit_logs_on_action"
29 | t.index %w[record_type record_id], name: "index_audit_logs_on_record_type_and_record_id"
30 | t.index %w[user_id action], name: "index_audit_logs_on_user_id_and_action"
31 | end
32 |
33 | create_table "comments", id: :serial, force: :cascade do |t|
34 | t.integer "topic_id"
35 | t.integer "user_id"
36 | t.string "body"
37 | t.datetime "created_at", null: false
38 | t.datetime "updated_at", null: false
39 | end
40 |
41 | create_table "topics", id: :serial, force: :cascade do |t|
42 | t.string "title"
43 | t.integer "user_id"
44 | t.datetime "created_at", null: false
45 | t.datetime "updated_at", null: false
46 | end
47 |
48 | create_table "users", id: :serial, force: :cascade do |t|
49 | t.string "email", default: "", null: false
50 | t.string "encrypted_password", default: "", null: false
51 | t.string "reset_password_token"
52 | t.datetime "reset_password_sent_at"
53 | t.datetime "remember_created_at"
54 | t.integer "sign_in_count", default: 0, null: false
55 | t.datetime "current_sign_in_at"
56 | t.datetime "last_sign_in_at"
57 | t.string "current_sign_in_ip"
58 | t.string "last_sign_in_ip"
59 | t.datetime "created_at", null: false
60 | t.datetime "updated_at", null: false
61 | t.index ["email"], name: "index_users_on_email", unique: true
62 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
63 | end
64 | end
65 |
--------------------------------------------------------------------------------
/test/dummy/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # This file should contain all the record creation needed to seed the database with its default values.
3 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
4 | #
5 | # Examples:
6 | #
7 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
8 | # Mayor.create(name: 'Emanuel', city: cities.first)
9 |
--------------------------------------------------------------------------------
/test/dummy/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rails-engine/audit-log/7fac678f007d9a7337a990f5ca7eb3d37351b477/test/dummy/lib/assets/.keep
--------------------------------------------------------------------------------
/test/dummy/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rails-engine/audit-log/7fac678f007d9a7337a990f5ca7eb3d37351b477/test/dummy/lib/tasks/.keep
--------------------------------------------------------------------------------
/test/dummy/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rails-engine/audit-log/7fac678f007d9a7337a990f5ca7eb3d37351b477/test/dummy/log/.keep
--------------------------------------------------------------------------------
/test/dummy/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.