introspective_admin 0.9.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.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +75 -0
  5. data/.ruby-version +1 -1
  6. data/Gemfile +20 -11
  7. data/Gemfile.lock +190 -135
  8. data/Rakefile +3 -5
  9. data/introspective_admin.gemspec +16 -21
  10. data/lib/introspective_admin/base.rb +64 -47
  11. data/lib/introspective_admin/version.rb +3 -1
  12. data/lib/introspective_admin.rb +2 -0
  13. data/lib/tasks/introspective_admin_tasks.rake +2 -0
  14. data/spec/admin/company_admin_spec.rb +24 -23
  15. data/spec/admin/job_admin_spec.rb +21 -19
  16. data/spec/admin/location_admin_spec.rb +27 -23
  17. data/spec/admin/location_beacon_admin_spec.rb +26 -24
  18. data/spec/admin/project__admin_spec.rb +26 -24
  19. data/spec/admin/user_admin_spec.rb +25 -24
  20. data/spec/dummy/Gemfile +6 -4
  21. data/spec/dummy/Rakefile +3 -1
  22. data/spec/dummy/app/admin/admin_users.rb +2 -1
  23. data/spec/dummy/app/admin/company_admin.rb +4 -3
  24. data/spec/dummy/app/admin/dashboard.rb +10 -8
  25. data/spec/dummy/app/admin/job_admin.rb +3 -2
  26. data/spec/dummy/app/admin/location_admin.rb +3 -2
  27. data/spec/dummy/app/admin/location_beacon_admin.rb +2 -0
  28. data/spec/dummy/app/admin/project_admin.rb +3 -4
  29. data/spec/dummy/app/admin/role_admin.rb +3 -3
  30. data/spec/dummy/app/admin/user_admin.rb +5 -5
  31. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  32. data/spec/dummy/app/helpers/application_helper.rb +2 -1
  33. data/spec/dummy/app/models/abstract_adapter.rb +10 -8
  34. data/spec/dummy/app/models/admin_user.rb +4 -2
  35. data/spec/dummy/app/models/company.rb +3 -2
  36. data/spec/dummy/app/models/job.rb +3 -3
  37. data/spec/dummy/app/models/locatable.rb +3 -1
  38. data/spec/dummy/app/models/location.rb +4 -3
  39. data/spec/dummy/app/models/location_beacon.rb +5 -5
  40. data/spec/dummy/app/models/location_gps.rb +2 -2
  41. data/spec/dummy/app/models/project.rb +6 -6
  42. data/spec/dummy/app/models/project_job.rb +2 -1
  43. data/spec/dummy/app/models/role.rb +8 -7
  44. data/spec/dummy/app/models/team.rb +2 -1
  45. data/spec/dummy/app/models/team_user.rb +5 -4
  46. data/spec/dummy/app/models/user.rb +22 -18
  47. data/spec/dummy/app/models/user_location.rb +14 -14
  48. data/spec/dummy/app/models/user_project_job.rb +4 -3
  49. data/spec/dummy/bin/bundle +3 -1
  50. data/spec/dummy/bin/rails +3 -1
  51. data/spec/dummy/bin/rake +2 -0
  52. data/spec/dummy/bin/setup +10 -8
  53. data/spec/dummy/config/application.rb +12 -11
  54. data/spec/dummy/config/boot.rb +4 -2
  55. data/spec/dummy/config/environment.rb +6 -5
  56. data/spec/dummy/config/environments/development.rb +3 -1
  57. data/spec/dummy/config/environments/production.rb +4 -3
  58. data/spec/dummy/config/environments/test.rb +5 -5
  59. data/spec/dummy/config/initializers/active_admin.rb +5 -4
  60. data/spec/dummy/config/initializers/assets.rb +3 -1
  61. data/spec/dummy/config/initializers/backtrace_silencers.rb +2 -0
  62. data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
  63. data/spec/dummy/config/initializers/devise.rb +2 -0
  64. data/spec/dummy/config/initializers/filter_parameter_logging.rb +2 -0
  65. data/spec/dummy/config/initializers/inflections.rb +2 -0
  66. data/spec/dummy/config/initializers/mime_types.rb +2 -0
  67. data/spec/dummy/config/initializers/session_store.rb +2 -0
  68. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -0
  69. data/spec/dummy/config/initializers/zeitwerk.rb +6 -4
  70. data/spec/dummy/config/routes.rb +5 -3
  71. data/spec/dummy/config.ru +3 -1
  72. data/spec/dummy/db/development.sqlite3 +0 -0
  73. data/spec/dummy/db/migrate/20141002205024_devise_create_users.rb +4 -3
  74. data/spec/dummy/db/migrate/20141002211055_devise_create_admin_users.rb +4 -3
  75. data/spec/dummy/db/migrate/20141002211057_create_active_admin_comments.rb +4 -2
  76. data/spec/dummy/db/migrate/20141002220722_add_lockable_to_users.rb +2 -0
  77. data/spec/dummy/db/migrate/20150406213646_create_companies.rb +2 -0
  78. data/spec/dummy/db/migrate/20150414213154_add_user_authentication_token.rb +4 -2
  79. data/spec/dummy/db/migrate/20150415222005_create_roles.rb +3 -2
  80. data/spec/dummy/db/migrate/20150505181635_create_chats.rb +2 -0
  81. data/spec/dummy/db/migrate/20150505181636_create_chat_users.rb +2 -0
  82. data/spec/dummy/db/migrate/20150505181640_create_chat_messages.rb +2 -0
  83. data/spec/dummy/db/migrate/20150507191529_create_chat_message_users.rb +2 -0
  84. data/spec/dummy/db/migrate/20150601200526_create_locations.rb +3 -1
  85. data/spec/dummy/db/migrate/20150601200533_create_locatables.rb +2 -0
  86. data/spec/dummy/db/migrate/20150601212924_create_location_beacons.rb +4 -2
  87. data/spec/dummy/db/migrate/20150601213542_create_location_gps.rb +2 -0
  88. data/spec/dummy/db/migrate/20150609201823_create_user_locations.rb +2 -0
  89. data/spec/dummy/db/migrate/20150617232519_create_projects.rb +2 -0
  90. data/spec/dummy/db/migrate/20150617232521_create_jobs.rb +2 -0
  91. data/spec/dummy/db/migrate/20150617232522_create_project_jobs.rb +3 -1
  92. data/spec/dummy/db/migrate/20150623170133_create_user_project_jobs.rb +3 -1
  93. data/spec/dummy/db/migrate/20150701234929_create_teams.rb +2 -0
  94. data/spec/dummy/db/migrate/20150701234930_create_team_users.rb +3 -1
  95. data/spec/dummy/db/migrate/20150727214950_add_confirmable_to_devise.rb +4 -2
  96. data/spec/dummy/db/migrate/20150820190524_add_user_names.rb +4 -2
  97. data/spec/dummy/db/migrate/20150909225019_add_password_to_project.rb +2 -0
  98. data/spec/dummy/db/migrate/20220806003731_add_devise_to_admin_users.rb +2 -3
  99. data/spec/dummy/db/schema.rb +197 -198
  100. data/spec/rails_helper.rb +17 -11
  101. data/spec/support/blueprints.rb +50 -49
  102. data/spec/support/location_helper.rb +28 -29
  103. metadata +13 -153
  104. data/spec/dummy/db/development.sqlite3-shm +0 -0
  105. data/spec/dummy/db/development.sqlite3-wal +0 -0
  106. data/spec/dummy/introspective_admin.gemspec +0 -34
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateRoles < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :roles do |t|
@@ -6,7 +8,6 @@ class CreateRoles < ActiveRecord::Migration
6
8
 
7
9
  t.timestamps null: false
8
10
  end
9
- add_index :roles, [:user_id,:ownable_type,:ownable_id], unique: true
11
+ add_index :roles, %i[user_id ownable_type ownable_id], unique: true
10
12
  end
11
-
12
13
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateChats < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :chats do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateChatUsers < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :chat_users do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateChatMessages < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :chat_messages do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateChatMessageUsers < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :chat_message_users do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateLocations < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :locations do |t|
@@ -8,6 +10,6 @@ class CreateLocations < ActiveRecord::Migration
8
10
 
9
11
  t.timestamps null: false
10
12
  end
11
- add_index :locations, [:parent_location_id,:kind,:name], unique: true
13
+ add_index :locations, %i[parent_location_id kind name], unique: true
12
14
  end
13
15
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateLocatables < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :locatables do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateLocationBeacons < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :location_beacons do |t|
@@ -5,12 +7,12 @@ class CreateLocationBeacons < ActiveRecord::Migration
5
7
  t.references :company, null: false
6
8
  t.string :mac_address, limit: 12
7
9
  t.string :uuid, null: false, limit: 32
8
- t.integer :major, null: false
10
+ t.integer :major, null: false
9
11
  t.integer :minor, null: false
10
12
  t.integer :last_known_battery_level
11
13
 
12
14
  t.timestamps null: false
13
15
  end
14
- add_index :location_beacons, [:company_id,:uuid,:major,:minor], name: "index_location_beacons_unique_company_identifier", unique: true
16
+ add_index :location_beacons, %i[company_id uuid major minor], name: 'index_location_beacons_unique_company_identifier', unique: true
15
17
  end
16
18
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateLocationGps < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :location_gps do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateUserLocations < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :user_locations do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateProjects < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :projects do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateJobs < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :jobs do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateProjectJobs < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :project_jobs do |t|
@@ -6,6 +8,6 @@ class CreateProjectJobs < ActiveRecord::Migration
6
8
 
7
9
  t.timestamps null: false
8
10
  end
9
- add_index :project_jobs, [:project_id,:job_id], unique: true
11
+ add_index :project_jobs, %i[project_id job_id], unique: true
10
12
  end
11
13
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateUserProjectJobs < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :user_project_jobs do |t|
@@ -7,6 +9,6 @@ class CreateUserProjectJobs < ActiveRecord::Migration
7
9
 
8
10
  t.timestamps null: false
9
11
  end
10
- add_index :user_project_jobs, [:user_id,:project_id,:job_id], unique: true
12
+ add_index :user_project_jobs, %i[user_id project_id job_id], unique: true
11
13
  end
12
14
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateTeams < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :teams do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateTeamUsers < ActiveRecord::Migration
2
4
  def change
3
5
  create_table :team_users do |t|
@@ -6,6 +8,6 @@ class CreateTeamUsers < ActiveRecord::Migration
6
8
 
7
9
  t.timestamps null: false
8
10
  end
9
- add_index :team_users, [:user_id,:team_id], unique: true
11
+ add_index :team_users, %i[user_id team_id], unique: true
10
12
  end
11
13
  end
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddConfirmableToDevise < ActiveRecord::Migration
2
4
  def change
3
- change_table(:users) do |t|
5
+ change_table(:users) do |t|
4
6
  t.string :confirmation_token
5
7
  t.datetime :confirmed_at
6
8
  t.datetime :confirmation_sent_at
7
9
  t.string :unconfirmed_email
8
10
  end
9
- add_index :users, :confirmation_token, unique: true
11
+ add_index :users, :confirmation_token, unique: true
10
12
  end
11
13
  end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddUserNames < ActiveRecord::Migration
2
4
  def change
3
- add_column :users, :first_name, :string
4
- add_column :users, :last_name, :string
5
+ add_column :users, :first_name, :string
6
+ add_column :users, :last_name, :string
5
7
  end
6
8
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddPasswordToProject < ActiveRecord::Migration
2
4
  def change
3
5
  add_column :projects, :default_password, :string
@@ -4,8 +4,8 @@ class AddDeviseToAdminUsers < ActiveRecord::Migration[5.2]
4
4
  def self.up
5
5
  change_table :admin_users do |t|
6
6
  ## Database authenticatable
7
- t.string :email, null: false, default: ""
8
- t.string :encrypted_password, null: false, default: ""
7
+ t.string :email, null: false, default: ''
8
+ t.string :encrypted_password, null: false, default: ''
9
9
 
10
10
  ## Recoverable
11
11
  t.string :reset_password_token
@@ -32,7 +32,6 @@ class AddDeviseToAdminUsers < ActiveRecord::Migration[5.2]
32
32
  # t.string :unlock_token # Only if unlock strategy is :email or :both
33
33
  # t.datetime :locked_at
34
34
 
35
-
36
35
  # Uncomment below if timestamps were not included in your original model.
37
36
  # t.timestamps null: false
38
37
  end