activeadmin-ajax_filter 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yaml +1 -1
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +65 -59
  5. data/README.md +10 -13
  6. data/activeadmin-ajax_filter.gemspec +2 -2
  7. data/lib/active_admin/ajax_filter/version.rb +1 -1
  8. data/test_app/blog/.gitattributes +7 -0
  9. data/test_app/blog/.gitignore +35 -0
  10. data/test_app/blog/.ruby-version +1 -0
  11. data/test_app/blog/Gemfile +83 -0
  12. data/test_app/blog/Gemfile.lock +345 -0
  13. data/test_app/blog/README.md +24 -0
  14. data/test_app/blog/Rakefile +6 -0
  15. data/test_app/blog/app/admin/admin_users.rb +28 -0
  16. data/test_app/blog/app/admin/categories.rb +7 -0
  17. data/test_app/blog/app/admin/dashboard.rb +32 -0
  18. data/test_app/blog/app/admin/items.rb +38 -0
  19. data/test_app/blog/app/admin/subcategories.rb +8 -0
  20. data/test_app/blog/app/admin/tags.rb +22 -0
  21. data/test_app/blog/app/assets/config/manifest.js +2 -0
  22. data/test_app/blog/app/assets/images/.keep +0 -0
  23. data/test_app/blog/app/assets/javascripts/active_admin.js +4 -0
  24. data/test_app/blog/app/assets/stylesheets/active_admin.scss +21 -0
  25. data/test_app/blog/app/assets/stylesheets/application.css +15 -0
  26. data/test_app/blog/app/channels/application_cable/channel.rb +4 -0
  27. data/test_app/blog/app/channels/application_cable/connection.rb +4 -0
  28. data/test_app/blog/app/controllers/application_controller.rb +2 -0
  29. data/test_app/blog/app/controllers/concerns/.keep +0 -0
  30. data/test_app/blog/app/decorators/subcategory_decorator.rb +5 -0
  31. data/test_app/blog/app/helpers/application_helper.rb +2 -0
  32. data/test_app/blog/app/jobs/application_job.rb +7 -0
  33. data/test_app/blog/app/mailers/application_mailer.rb +4 -0
  34. data/test_app/blog/app/models/admin_user.rb +6 -0
  35. data/test_app/blog/app/models/application_record.rb +3 -0
  36. data/test_app/blog/app/models/category.rb +6 -0
  37. data/test_app/blog/app/models/concerns/.keep +0 -0
  38. data/test_app/blog/app/models/item.rb +6 -0
  39. data/test_app/blog/app/models/subcategory.rb +8 -0
  40. data/test_app/blog/app/models/tag.rb +6 -0
  41. data/test_app/blog/app/views/layouts/application.html.erb +15 -0
  42. data/test_app/blog/app/views/layouts/mailer.html.erb +13 -0
  43. data/test_app/blog/app/views/layouts/mailer.text.erb +1 -0
  44. data/test_app/blog/bin/bundle +114 -0
  45. data/test_app/blog/bin/rails +4 -0
  46. data/test_app/blog/bin/rake +4 -0
  47. data/test_app/blog/bin/setup +33 -0
  48. data/test_app/blog/config/application.rb +22 -0
  49. data/test_app/blog/config/boot.rb +4 -0
  50. data/test_app/blog/config/cable.yml +10 -0
  51. data/test_app/blog/config/credentials.yml.enc +1 -0
  52. data/test_app/blog/config/database.yml +25 -0
  53. data/test_app/blog/config/environment.rb +5 -0
  54. data/test_app/blog/config/environments/development.rb +70 -0
  55. data/test_app/blog/config/environments/production.rb +93 -0
  56. data/test_app/blog/config/environments/test.rb +60 -0
  57. data/test_app/blog/config/initializers/active_admin.rb +335 -0
  58. data/test_app/blog/config/initializers/assets.rb +12 -0
  59. data/test_app/blog/config/initializers/content_security_policy.rb +25 -0
  60. data/test_app/blog/config/initializers/devise.rb +313 -0
  61. data/test_app/blog/config/initializers/filter_parameter_logging.rb +8 -0
  62. data/test_app/blog/config/initializers/inflections.rb +16 -0
  63. data/test_app/blog/config/initializers/permissions_policy.rb +11 -0
  64. data/test_app/blog/config/locales/devise.en.yml +65 -0
  65. data/test_app/blog/config/locales/en.yml +33 -0
  66. data/test_app/blog/config/puma.rb +43 -0
  67. data/test_app/blog/config/routes.rb +8 -0
  68. data/test_app/blog/config/storage.yml +34 -0
  69. data/test_app/blog/config.ru +6 -0
  70. data/test_app/blog/db/migrate/20230425060437_devise_create_admin_users.rb +44 -0
  71. data/test_app/blog/db/migrate/20230425060439_create_active_admin_comments.rb +16 -0
  72. data/test_app/blog/db/migrate/20230425060707_initial_schema.rb +17 -0
  73. data/test_app/blog/db/migrate/20230425060708_create_tags.rb +13 -0
  74. data/test_app/blog/db/schema.rb +69 -0
  75. data/test_app/blog/db/seeds.rb +33 -0
  76. data/test_app/blog/lib/assets/.keep +0 -0
  77. data/test_app/blog/lib/tasks/.keep +0 -0
  78. data/test_app/blog/log/.keep +0 -0
  79. data/test_app/blog/public/404.html +67 -0
  80. data/test_app/blog/public/422.html +67 -0
  81. data/test_app/blog/public/500.html +66 -0
  82. data/test_app/blog/public/apple-touch-icon-precomposed.png +0 -0
  83. data/test_app/blog/public/apple-touch-icon.png +0 -0
  84. data/test_app/blog/public/favicon.ico +0 -0
  85. data/test_app/blog/public/robots.txt +1 -0
  86. data/test_app/blog/storage/.keep +0 -0
  87. data/test_app/blog/test/application_system_test_case.rb +5 -0
  88. data/test_app/blog/test/channels/application_cable/connection_test.rb +11 -0
  89. data/test_app/blog/test/controllers/.keep +0 -0
  90. data/test_app/blog/test/fixtures/admin_users.yml +11 -0
  91. data/test_app/blog/test/fixtures/files/.keep +0 -0
  92. data/test_app/blog/test/helpers/.keep +0 -0
  93. data/test_app/blog/test/integration/.keep +0 -0
  94. data/test_app/blog/test/mailers/.keep +0 -0
  95. data/test_app/blog/test/models/.keep +0 -0
  96. data/test_app/blog/test/models/admin_user_test.rb +7 -0
  97. data/test_app/blog/test/system/.keep +0 -0
  98. data/test_app/blog/test/test_helper.rb +13 -0
  99. data/test_app/blog/tmp/.keep +0 -0
  100. data/test_app/blog/tmp/pids/.keep +0 -0
  101. data/test_app/blog/tmp/storage/.keep +0 -0
  102. data/test_app/blog/vendor/.keep +0 -0
  103. metadata +101 -21
  104. data/.travis.yml +0 -26
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, "\\1en"
8
+ # inflect.singular /^(ox)en/i, "\\1"
9
+ # inflect.irregular "person", "people"
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym "RESTful"
16
+ # end
@@ -0,0 +1,11 @@
1
+ # Define an application-wide HTTP permissions policy. For further
2
+ # information see https://developers.google.com/web/updates/2018/06/feature-policy
3
+ #
4
+ # Rails.application.config.permissions_policy do |f|
5
+ # f.camera :none
6
+ # f.gyroscope :none
7
+ # f.microphone :none
8
+ # f.usb :none
9
+ # f.fullscreen :self
10
+ # f.payment :self, "https://secure.example.com"
11
+ # end
@@ -0,0 +1,65 @@
1
+ # Additional translations at https://github.com/heartcombo/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
+ email_changed:
27
+ subject: "Email Changed"
28
+ password_change:
29
+ subject: "Password Changed"
30
+ omniauth_callbacks:
31
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
32
+ success: "Successfully authenticated from %{kind} account."
33
+ passwords:
34
+ 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."
35
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
36
+ 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."
37
+ updated: "Your password has been changed successfully. You are now signed in."
38
+ updated_not_active: "Your password has been changed successfully."
39
+ registrations:
40
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
41
+ signed_up: "Welcome! You have signed up successfully."
42
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
43
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
44
+ 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."
45
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
46
+ updated: "Your account has been updated successfully."
47
+ updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
48
+ sessions:
49
+ signed_in: "Signed in successfully."
50
+ signed_out: "Signed out successfully."
51
+ already_signed_out: "Signed out successfully."
52
+ unlocks:
53
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
54
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
55
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
56
+ errors:
57
+ messages:
58
+ already_confirmed: "was already confirmed, please try signing in"
59
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
60
+ expired: "has expired, please request a new one"
61
+ not_found: "not found"
62
+ not_locked: "was not locked"
63
+ not_saved:
64
+ one: "1 error prohibited this %{resource} from being saved:"
65
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,33 @@
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
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # "true": "foo"
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at https://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,43 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9
+ threads min_threads_count, max_threads_count
10
+
11
+ # Specifies the `worker_timeout` threshold that Puma will use to wait before
12
+ # terminating a worker in development environments.
13
+ #
14
+ worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15
+
16
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
17
+ #
18
+ port ENV.fetch("PORT") { 3000 }
19
+
20
+ # Specifies the `environment` that Puma will run in.
21
+ #
22
+ environment ENV.fetch("RAILS_ENV") { "development" }
23
+
24
+ # Specifies the `pidfile` that Puma will use.
25
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
26
+
27
+ # Specifies the number of `workers` to boot in clustered mode.
28
+ # Workers are forked web server processes. If using threads and workers together
29
+ # the concurrency of the application would be max `threads` * `workers`.
30
+ # Workers do not work on JRuby or Windows (both of which do not support
31
+ # processes).
32
+ #
33
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
34
+
35
+ # Use the `preload_app!` method when specifying a `workers` number.
36
+ # This directive tells Puma to first boot the application and load code
37
+ # before forking the application. This takes advantage of Copy On Write
38
+ # process behavior so workers use less memory.
39
+ #
40
+ # preload_app!
41
+
42
+ # Allow puma to be restarted by `bin/rails restart` command.
43
+ plugin :tmp_restart
@@ -0,0 +1,8 @@
1
+ Rails.application.routes.draw do
2
+ devise_for :admin_users, ActiveAdmin::Devise.config
3
+ ActiveAdmin.routes(self)
4
+ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
5
+
6
+ # Defines the root path route ("/")
7
+ # root "articles#index"
8
+ end
@@ -0,0 +1,34 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket-<%= Rails.env %>
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket-<%= Rails.env %>
23
+
24
+ # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+ # microsoft:
26
+ # service: AzureStorage
27
+ # storage_account_name: your_account_name
28
+ # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+ # container: your_container_name-<%= Rails.env %>
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -0,0 +1,6 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative "config/environment"
4
+
5
+ run Rails.application
6
+ Rails.application.load_server
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ class DeviseCreateAdminUsers < ActiveRecord::Migration[7.0]
4
+ def change
5
+ create_table :admin_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
+
36
+ t.timestamps null: false
37
+ end
38
+
39
+ add_index :admin_users, :email, unique: true
40
+ add_index :admin_users, :reset_password_token, unique: true
41
+ # add_index :admin_users, :confirmation_token, unique: true
42
+ # add_index :admin_users, :unlock_token, unique: true
43
+ end
44
+ end
@@ -0,0 +1,16 @@
1
+ class CreateActiveAdminComments < ActiveRecord::Migration[7.0]
2
+ def self.up
3
+ create_table :active_admin_comments do |t|
4
+ t.string :namespace
5
+ t.text :body
6
+ t.references :resource, polymorphic: true
7
+ t.references :author, polymorphic: true
8
+ t.timestamps
9
+ end
10
+ add_index :active_admin_comments, [:namespace]
11
+ end
12
+
13
+ def self.down
14
+ drop_table :active_admin_comments
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ class InitialSchema < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :categories do |t|
4
+ t.string :name, null: false
5
+ end
6
+
7
+ create_table :subcategories do |t|
8
+ t.string :name, null: false
9
+ t.references :category, null: false, index: true
10
+ end
11
+
12
+ create_table :items do |t|
13
+ t.string :name, null: false
14
+ t.references :subcategory, null: false, index: true
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ class CreateTags < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :tags do |t|
4
+ t.string :name, null: false
5
+ t.references :subcategory, null: false, index: true
6
+ end
7
+
8
+ create_join_table :items, :tags do |t|
9
+ t.index [:item_id, :tag_id]
10
+ t.index [:tag_id, :item_id]
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,69 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[7.0].define(version: 2023_04_25_060708) do
14
+ create_table "active_admin_comments", force: :cascade do |t|
15
+ t.string "namespace"
16
+ t.text "body"
17
+ t.string "resource_type"
18
+ t.integer "resource_id"
19
+ t.string "author_type"
20
+ t.integer "author_id"
21
+ t.datetime "created_at", null: false
22
+ t.datetime "updated_at", null: false
23
+ t.index ["author_type", "author_id"], name: "index_active_admin_comments_on_author"
24
+ t.index ["namespace"], name: "index_active_admin_comments_on_namespace"
25
+ t.index ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource"
26
+ end
27
+
28
+ create_table "admin_users", force: :cascade do |t|
29
+ t.string "email", default: "", null: false
30
+ t.string "encrypted_password", default: "", null: false
31
+ t.string "reset_password_token"
32
+ t.datetime "reset_password_sent_at"
33
+ t.datetime "remember_created_at"
34
+ t.datetime "created_at", null: false
35
+ t.datetime "updated_at", null: false
36
+ t.index ["email"], name: "index_admin_users_on_email", unique: true
37
+ t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
38
+ end
39
+
40
+ create_table "categories", force: :cascade do |t|
41
+ t.string "name", null: false
42
+ end
43
+
44
+ create_table "items", force: :cascade do |t|
45
+ t.string "name", null: false
46
+ t.integer "subcategory_id", null: false
47
+ t.index ["subcategory_id"], name: "index_items_on_subcategory_id"
48
+ end
49
+
50
+ create_table "items_tags", id: false, force: :cascade do |t|
51
+ t.integer "item_id", null: false
52
+ t.integer "tag_id", null: false
53
+ t.index ["item_id", "tag_id"], name: "index_items_tags_on_item_id_and_tag_id"
54
+ t.index ["tag_id", "item_id"], name: "index_items_tags_on_tag_id_and_item_id"
55
+ end
56
+
57
+ create_table "subcategories", force: :cascade do |t|
58
+ t.string "name", null: false
59
+ t.integer "category_id", null: false
60
+ t.index ["category_id"], name: "index_subcategories_on_category_id"
61
+ end
62
+
63
+ create_table "tags", force: :cascade do |t|
64
+ t.string "name", null: false
65
+ t.integer "subcategory_id", null: false
66
+ t.index ["subcategory_id"], name: "index_tags_on_subcategory_id"
67
+ end
68
+
69
+ end
@@ -0,0 +1,33 @@
1
+ require 'faker'
2
+
3
+ # This file should contain all the record creation needed to seed the database with its default values.
4
+ # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
5
+ #
6
+ # Examples:
7
+ #
8
+ # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
9
+ # Character.create(name: "Luke", movie: movies.first)
10
+ # AdminUser.create!(email: 'admin@example.com', password: 'password', password_confirmation: 'password') if Rails.env.development?
11
+
12
+
13
+ ActiveRecord::Base.transaction do
14
+ categories = 5.times.map { Category.create!(name: Faker::Fantasy::Tolkien.unique.location ) }
15
+
16
+ subcategories = categories.flat_map do |category|
17
+ 3.times.map { Subcategory.create!(category: category, name: Faker::Fantasy::Tolkien.unique.location) }
18
+ end
19
+
20
+ tags = subcategories.flat_map do |subcategory|
21
+ 3.times.map { Tag.create!(subcategory: subcategory, name: Faker::Music.unique.band) }
22
+ end
23
+
24
+ items = subcategories.flat_map do |subcategory|
25
+ 5.times.map do
26
+ Item.create!(
27
+ subcategory: subcategory,
28
+ name: Faker::Fantasy::Tolkien.unique.character,
29
+ tags: 2.times.map { tags.sample }
30
+ )
31
+ end
32
+ end
33
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
File without changes
@@ -0,0 +1 @@
1
+ # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
File without changes
@@ -0,0 +1,5 @@
1
+ require "test_helper"
2
+
3
+ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4
+ driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
5
+ end
@@ -0,0 +1,11 @@
1
+ require "test_helper"
2
+
3
+ class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
4
+ # test "connects with cookies" do
5
+ # cookies.signed[:user_id] = 42
6
+ #
7
+ # connect
8
+ #
9
+ # assert_equal connection.user_id, "42"
10
+ # end
11
+ end
File without changes