introspective_admin 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +75 -0
- data/.ruby-version +1 -1
- data/.travis.yml +5 -14
- data/CHANGELOG.md +37 -28
- data/Gemfile +24 -6
- data/Gemfile.lock +402 -264
- data/README.md +34 -8
- data/Rakefile +3 -5
- data/introspective_admin.gemspec +29 -44
- data/lib/introspective_admin/base.rb +217 -200
- data/lib/introspective_admin/version.rb +5 -3
- data/lib/introspective_admin.rb +2 -0
- data/lib/tasks/introspective_admin_tasks.rake +2 -0
- data/spec/admin/company_admin_spec.rb +73 -72
- data/spec/admin/job_admin_spec.rb +63 -61
- data/spec/admin/location_admin_spec.rb +70 -66
- data/spec/admin/location_beacon_admin_spec.rb +75 -73
- data/spec/admin/project__admin_spec.rb +73 -71
- data/spec/admin/user_admin_spec.rb +65 -64
- data/spec/dummy/Gemfile +17 -0
- data/spec/dummy/README.rdoc +28 -28
- data/spec/dummy/Rakefile +8 -6
- data/spec/dummy/app/admin/admin_users.rb +29 -0
- data/spec/dummy/app/admin/company_admin.rb +5 -4
- data/spec/dummy/app/admin/dashboard.rb +34 -0
- data/spec/dummy/app/admin/job_admin.rb +5 -4
- data/spec/dummy/app/admin/location_admin.rb +5 -4
- data/spec/dummy/app/admin/location_beacon_admin.rb +8 -6
- data/spec/dummy/app/admin/project_admin.rb +5 -6
- data/spec/dummy/app/admin/role_admin.rb +5 -5
- data/spec/dummy/app/admin/user_admin.rb +13 -13
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/javascripts/active_admin.js +1 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -13
- data/spec/dummy/app/assets/stylesheets/active_admin.scss +17 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -15
- data/spec/dummy/app/controllers/application_controller.rb +10 -8
- data/spec/dummy/app/helpers/application_helper.rb +4 -3
- data/spec/dummy/app/models/abstract_adapter.rb +20 -12
- data/spec/dummy/app/models/admin_user.rb +12 -6
- data/spec/dummy/app/models/company.rb +13 -12
- data/spec/dummy/app/models/job.rb +10 -10
- data/spec/dummy/app/models/locatable.rb +8 -6
- data/spec/dummy/app/models/location.rb +27 -26
- data/spec/dummy/app/models/location_beacon.rb +19 -19
- data/spec/dummy/app/models/location_gps.rb +11 -11
- data/spec/dummy/app/models/project.rb +20 -20
- data/spec/dummy/app/models/project_job.rb +8 -7
- data/spec/dummy/app/models/role.rb +26 -25
- data/spec/dummy/app/models/team.rb +10 -9
- data/spec/dummy/app/models/team_user.rb +14 -13
- data/spec/dummy/app/models/user.rb +72 -68
- data/spec/dummy/app/models/user_location.rb +28 -28
- data/spec/dummy/app/models/user_project_job.rb +17 -16
- data/spec/dummy/app/views/layouts/application.html.erb +13 -13
- data/spec/dummy/bin/bundle +5 -3
- data/spec/dummy/bin/rails +6 -4
- data/spec/dummy/bin/rake +6 -4
- data/spec/dummy/bin/setup +31 -29
- data/spec/dummy/config/application.rb +35 -34
- data/spec/dummy/config/boot.rb +7 -5
- data/spec/dummy/config/database.yml +22 -22
- data/spec/dummy/config/environment.rb +12 -11
- data/spec/dummy/config/environments/development.rb +47 -45
- data/spec/dummy/config/environments/production.rb +83 -82
- data/spec/dummy/config/environments/test.rb +50 -50
- data/spec/dummy/config/initializers/active_admin.rb +8 -7
- data/spec/dummy/config/initializers/assets.rb +15 -13
- data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -3
- data/spec/dummy/config/initializers/devise.rb +265 -263
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -4
- data/spec/dummy/config/initializers/inflections.rb +18 -16
- data/spec/dummy/config/initializers/mime_types.rb +6 -4
- data/spec/dummy/config/initializers/session_store.rb +5 -3
- data/spec/dummy/config/initializers/wrap_parameters.rb +16 -14
- data/spec/dummy/config/initializers/zeitwerk.rb +10 -0
- data/spec/dummy/config/locales/devise.en.yml +60 -60
- data/spec/dummy/config/locales/en.yml +23 -23
- data/spec/dummy/config/routes.rb +12 -9
- data/spec/dummy/config/secrets.yml +20 -20
- data/spec/dummy/config.ru +6 -4
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20141002205024_devise_create_users.rb +43 -42
- data/spec/dummy/db/migrate/20141002211055_devise_create_admin_users.rb +49 -48
- data/spec/dummy/db/migrate/20141002211057_create_active_admin_comments.rb +21 -19
- data/spec/dummy/db/migrate/20141002220722_add_lockable_to_users.rb +10 -8
- data/spec/dummy/db/migrate/20150406213646_create_companies.rb +13 -11
- data/spec/dummy/db/migrate/20150414213154_add_user_authentication_token.rb +13 -11
- data/spec/dummy/db/migrate/20150415222005_create_roles.rb +13 -12
- data/spec/dummy/db/migrate/20150505181635_create_chats.rb +11 -9
- data/spec/dummy/db/migrate/20150505181636_create_chat_users.rb +13 -11
- data/spec/dummy/db/migrate/20150505181640_create_chat_messages.rb +13 -11
- data/spec/dummy/db/migrate/20150507191529_create_chat_message_users.rb +13 -11
- data/spec/dummy/db/migrate/20150601200526_create_locations.rb +15 -13
- data/spec/dummy/db/migrate/20150601200533_create_locatables.rb +12 -10
- data/spec/dummy/db/migrate/20150601212924_create_location_beacons.rb +18 -16
- data/spec/dummy/db/migrate/20150601213542_create_location_gps.rb +14 -12
- data/spec/dummy/db/migrate/20150609201823_create_user_locations.rb +16 -14
- data/spec/dummy/db/migrate/20150617232519_create_projects.rb +12 -10
- data/spec/dummy/db/migrate/20150617232521_create_jobs.rb +11 -9
- data/spec/dummy/db/migrate/20150617232522_create_project_jobs.rb +13 -11
- data/spec/dummy/db/migrate/20150623170133_create_user_project_jobs.rb +14 -12
- data/spec/dummy/db/migrate/20150701234929_create_teams.rb +13 -11
- data/spec/dummy/db/migrate/20150701234930_create_team_users.rb +13 -11
- data/spec/dummy/db/migrate/20150727214950_add_confirmable_to_devise.rb +13 -11
- data/spec/dummy/db/migrate/20150820190524_add_user_names.rb +8 -6
- data/spec/dummy/db/migrate/20150909225019_add_password_to_project.rb +7 -5
- data/spec/dummy/db/migrate/20220806003731_add_devise_to_admin_users.rb +50 -0
- data/spec/dummy/db/schema.rb +263 -264
- data/spec/dummy/public/404.html +67 -67
- data/spec/dummy/public/422.html +67 -67
- data/spec/dummy/public/500.html +66 -66
- data/spec/rails_helper.rb +33 -27
- data/spec/support/blueprints.rb +50 -49
- data/spec/support/location_helper.rb +28 -29
- metadata +21 -252
- data/Gemfile.lock.rails4 +0 -256
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
#
|
|
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] if respond_to?(:wrap_parameters)
|
|
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
|
|
@@ -1,60 +1,60 @@
|
|
|
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
|
-
omniauth_callbacks:
|
|
27
|
-
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
|
28
|
-
success: "Successfully authenticated from %{kind} account."
|
|
29
|
-
passwords:
|
|
30
|
-
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."
|
|
31
|
-
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
|
32
|
-
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."
|
|
33
|
-
updated: "Your password has been changed successfully. You are now signed in."
|
|
34
|
-
updated_not_active: "Your password has been changed successfully."
|
|
35
|
-
registrations:
|
|
36
|
-
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
|
37
|
-
signed_up: "Welcome! You have signed up successfully."
|
|
38
|
-
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
|
39
|
-
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
|
40
|
-
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."
|
|
41
|
-
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."
|
|
42
|
-
updated: "Your account has been updated successfully."
|
|
43
|
-
sessions:
|
|
44
|
-
signed_in: "Signed in successfully."
|
|
45
|
-
signed_out: "Signed out successfully."
|
|
46
|
-
already_signed_out: "Signed out successfully."
|
|
47
|
-
unlocks:
|
|
48
|
-
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
|
49
|
-
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
|
50
|
-
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
|
51
|
-
errors:
|
|
52
|
-
messages:
|
|
53
|
-
already_confirmed: "was already confirmed, please try signing in"
|
|
54
|
-
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
|
55
|
-
expired: "has expired, please request a new one"
|
|
56
|
-
not_found: "not found"
|
|
57
|
-
not_locked: "was not locked"
|
|
58
|
-
not_saved:
|
|
59
|
-
one: "1 error prohibited this %{resource} from being saved:"
|
|
60
|
-
other: "%{count} errors prohibited this %{resource} from being saved:"
|
|
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
|
+
omniauth_callbacks:
|
|
27
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
|
28
|
+
success: "Successfully authenticated from %{kind} account."
|
|
29
|
+
passwords:
|
|
30
|
+
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."
|
|
31
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
|
32
|
+
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."
|
|
33
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
|
34
|
+
updated_not_active: "Your password has been changed successfully."
|
|
35
|
+
registrations:
|
|
36
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
|
37
|
+
signed_up: "Welcome! You have signed up successfully."
|
|
38
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
|
39
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
|
40
|
+
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."
|
|
41
|
+
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."
|
|
42
|
+
updated: "Your account has been updated successfully."
|
|
43
|
+
sessions:
|
|
44
|
+
signed_in: "Signed in successfully."
|
|
45
|
+
signed_out: "Signed out successfully."
|
|
46
|
+
already_signed_out: "Signed out successfully."
|
|
47
|
+
unlocks:
|
|
48
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
|
49
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
|
50
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
|
51
|
+
errors:
|
|
52
|
+
messages:
|
|
53
|
+
already_confirmed: "was already confirmed, please try signing in"
|
|
54
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
|
55
|
+
expired: "has expired, please request a new one"
|
|
56
|
+
not_found: "not found"
|
|
57
|
+
not_locked: "was not locked"
|
|
58
|
+
not_saved:
|
|
59
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
|
60
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
|
@@ -1,23 +1,23 @@
|
|
|
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"
|
|
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"
|
data/spec/dummy/config/routes.rb
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
ActiveAdmin.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Rails.application.routes.draw do
|
|
4
|
+
# devise_for :admin_users, ActiveAdmin::Devise.config
|
|
5
|
+
# devise_for :admin_users, ActiveAdmin::Devise.config
|
|
6
|
+
devise_for :users
|
|
7
|
+
|
|
8
|
+
ActiveAdmin.routes(self)
|
|
9
|
+
|
|
10
|
+
# You can have the root of your site routed with "root"
|
|
11
|
+
root 'home#index'
|
|
12
|
+
end
|
|
@@ -1,20 +1,20 @@
|
|
|
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 `rake 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: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
|
|
15
|
-
|
|
16
|
-
test:
|
|
17
|
-
secret_key_base: ca9d4587a556cfc28464dcf7f9d73b396e53b814cd339a469bc817011485510d3a9d1d6a7fa08f65cce65bcd55727a7110de0077a952f50ce58a956b255c6903
|
|
18
|
-
|
|
19
|
-
production:
|
|
20
|
-
secret_key_base: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
|
|
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 `rake 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: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
|
|
15
|
+
|
|
16
|
+
test:
|
|
17
|
+
secret_key_base: ca9d4587a556cfc28464dcf7f9d73b396e53b814cd339a469bc817011485510d3a9d1d6a7fa08f65cce65bcd55727a7110de0077a952f50ce58a956b255c6903
|
|
18
|
+
|
|
19
|
+
production:
|
|
20
|
+
secret_key_base: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
|
data/spec/dummy/config.ru
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
Binary file
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
t.
|
|
19
|
-
t.
|
|
20
|
-
t.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# t.
|
|
26
|
-
# t.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
# t.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
add_index :users, :
|
|
39
|
-
|
|
40
|
-
# add_index :users, :
|
|
41
|
-
|
|
42
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
|
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
|
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
t.
|
|
25
|
-
t.
|
|
26
|
-
t.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
# t.
|
|
32
|
-
# t.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
# t.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
add_index :admin_users, :
|
|
45
|
-
|
|
46
|
-
# add_index :admin_users, :
|
|
47
|
-
|
|
48
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class DeviseCreateAdminUsers < ActiveRecord::Migration
|
|
4
|
+
def migrate(direction)
|
|
5
|
+
super
|
|
6
|
+
# Create a default user
|
|
7
|
+
AdminUser.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password') if direction == :up
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def change
|
|
11
|
+
create_table(:admin_users) do |t|
|
|
12
|
+
## Database authenticatable
|
|
13
|
+
t.string :email, null: false, default: ''
|
|
14
|
+
t.string :encrypted_password, null: false, default: ''
|
|
15
|
+
|
|
16
|
+
## Recoverable
|
|
17
|
+
t.string :reset_password_token
|
|
18
|
+
t.datetime :reset_password_sent_at
|
|
19
|
+
|
|
20
|
+
## Rememberable
|
|
21
|
+
t.datetime :remember_created_at
|
|
22
|
+
|
|
23
|
+
## Trackable
|
|
24
|
+
t.integer :sign_in_count, default: 0, null: false
|
|
25
|
+
t.datetime :current_sign_in_at
|
|
26
|
+
t.datetime :last_sign_in_at
|
|
27
|
+
t.string :current_sign_in_ip
|
|
28
|
+
t.string :last_sign_in_ip
|
|
29
|
+
|
|
30
|
+
## Confirmable
|
|
31
|
+
# t.string :confirmation_token
|
|
32
|
+
# t.datetime :confirmed_at
|
|
33
|
+
# t.datetime :confirmation_sent_at
|
|
34
|
+
# t.string :unconfirmed_email # Only if using reconfirmable
|
|
35
|
+
|
|
36
|
+
## Lockable
|
|
37
|
+
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
|
38
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
|
39
|
+
# t.datetime :locked_at
|
|
40
|
+
|
|
41
|
+
t.timestamps null: false
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
add_index :admin_users, :email, unique: true
|
|
45
|
+
add_index :admin_users, :reset_password_token, unique: true
|
|
46
|
+
# add_index :admin_users, :confirmation_token, unique: true
|
|
47
|
+
# add_index :admin_users, :unlock_token, unique: true
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
t.string :
|
|
7
|
-
t.
|
|
8
|
-
t.
|
|
9
|
-
t.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
add_index :active_admin_comments, [:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateActiveAdminComments < ActiveRecord::Migration
|
|
4
|
+
def self.up
|
|
5
|
+
create_table :active_admin_comments do |t|
|
|
6
|
+
t.string :namespace
|
|
7
|
+
t.text :body
|
|
8
|
+
t.string :resource_id, null: false, foreign_key: false
|
|
9
|
+
t.string :resource_type, null: false
|
|
10
|
+
t.references :author, polymorphic: true
|
|
11
|
+
t.timestamps null: false
|
|
12
|
+
end
|
|
13
|
+
add_index :active_admin_comments, [:namespace]
|
|
14
|
+
add_index :active_admin_comments, %i[author_type author_id]
|
|
15
|
+
add_index :active_admin_comments, %i[resource_type resource_id]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.down
|
|
19
|
+
drop_table :active_admin_comments
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
add_column :users, :
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AddLockableToUsers < ActiveRecord::Migration
|
|
4
|
+
def change
|
|
5
|
+
# add Lockable columns
|
|
6
|
+
add_column :users, :failed_attempts, :integer, default: 0, null: false
|
|
7
|
+
add_column :users, :unlock_token, :string
|
|
8
|
+
add_column :users, :locked_at, :datetime
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
t.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateCompanies < ActiveRecord::Migration
|
|
4
|
+
def change
|
|
5
|
+
create_table :companies do |t|
|
|
6
|
+
t.string :name, limit: 256, null: false
|
|
7
|
+
t.string :short_name, limit: 10, null: false
|
|
8
|
+
|
|
9
|
+
t.timestamps null: false
|
|
10
|
+
end
|
|
11
|
+
add_index :companies, :name, unique: true
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AddUserAuthenticationToken < ActiveRecord::Migration
|
|
4
|
+
def change
|
|
5
|
+
add_column :users, :authentication_token, :string
|
|
6
|
+
add_index :users, :authentication_token, unique: true
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def down
|
|
10
|
+
remove_index :users, :authentication_token
|
|
11
|
+
remove_column :users, :authentication_token
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
t.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateRoles < ActiveRecord::Migration
|
|
4
|
+
def change
|
|
5
|
+
create_table :roles do |t|
|
|
6
|
+
t.integer :user_id, null: false
|
|
7
|
+
t.references :ownable, polymorphic: true, index: true
|
|
8
|
+
|
|
9
|
+
t.timestamps null: false
|
|
10
|
+
end
|
|
11
|
+
add_index :roles, %i[user_id ownable_type ownable_id], unique: true
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
t.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateChats < ActiveRecord::Migration
|
|
4
|
+
def change
|
|
5
|
+
create_table :chats do |t|
|
|
6
|
+
t.integer :creator_id, references: :users, foreign_key: false
|
|
7
|
+
|
|
8
|
+
t.timestamps null: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|