add annotate gem
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -35,6 +35,7 @@ group :development, :test do
|
||||
end
|
||||
|
||||
group :development do
|
||||
gem "annotate"
|
||||
gem "graphql_playground-rails"
|
||||
gem "web-console", ">= 4.1.0"
|
||||
|
||||
|
||||
@@ -72,6 +72,9 @@ GEM
|
||||
momentjs-rails (~> 2.8)
|
||||
sassc-rails (~> 2.1)
|
||||
selectize-rails (~> 0.6)
|
||||
annotate (3.1.1)
|
||||
activerecord (>= 3.2, < 7.0)
|
||||
rake (>= 10.4, < 14.0)
|
||||
ast (2.4.2)
|
||||
bcrypt (3.1.16)
|
||||
bindex (0.8.1)
|
||||
@@ -310,6 +313,7 @@ PLATFORMS
|
||||
|
||||
DEPENDENCIES
|
||||
administrate
|
||||
annotate
|
||||
bootsnap (>= 1.4.4)
|
||||
capybara
|
||||
devise
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: admin_users
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# email :string default(""), not null
|
||||
# encrypted_password :string default(""), not null
|
||||
# remember_created_at :datetime
|
||||
# reset_password_sent_at :datetime
|
||||
# reset_password_token :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_admin_users_on_email (email) UNIQUE
|
||||
# index_admin_users_on_reset_password_token (reset_password_token) UNIQUE
|
||||
#
|
||||
class AdminUser < ApplicationRecord
|
||||
# Include default devise modules. Others available are:
|
||||
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
||||
|
||||
6
db/schema.rb
generated
6
db/schema.rb
generated
@@ -27,10 +27,4 @@ ActiveRecord::Schema.define(version: 2021_08_03_222524) do
|
||||
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
|
||||
end
|
||||
|
||||
create_table "customers", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
60
lib/tasks/auto_annotate_models.rake
Normal file
60
lib/tasks/auto_annotate_models.rake
Normal file
@@ -0,0 +1,60 @@
|
||||
# frozen_string_literal: true
|
||||
# NOTE: only doing this in development as some production environments (Heroku)
|
||||
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
|
||||
# NOTE: to have a dev-mode tool do its thing in production.
|
||||
if Rails.env.development?
|
||||
require "annotate"
|
||||
task set_annotation_options: :environment do
|
||||
# You can override any of these by setting an environment variable of the
|
||||
# same name.
|
||||
Annotate.set_defaults(
|
||||
"active_admin" => "false",
|
||||
"additional_file_patterns" => [],
|
||||
"routes" => "false",
|
||||
"models" => "true",
|
||||
"position_in_routes" => "before",
|
||||
"position_in_class" => "before",
|
||||
"position_in_test" => "before",
|
||||
"position_in_fixture" => "before",
|
||||
"position_in_factory" => "before",
|
||||
"position_in_serializer" => "before",
|
||||
"show_foreign_keys" => "true",
|
||||
"show_complete_foreign_keys" => "false",
|
||||
"show_indexes" => "true",
|
||||
"simple_indexes" => "false",
|
||||
"model_dir" => "app/models",
|
||||
"root_dir" => "",
|
||||
"include_version" => "false",
|
||||
"require" => "",
|
||||
"exclude_tests" => "false",
|
||||
"exclude_fixtures" => "false",
|
||||
"exclude_factories" => "false",
|
||||
"exclude_serializers" => "false",
|
||||
"exclude_scaffolds" => "true",
|
||||
"exclude_controllers" => "true",
|
||||
"exclude_helpers" => "true",
|
||||
"exclude_sti_subclasses" => "false",
|
||||
"ignore_model_sub_dir" => "false",
|
||||
"ignore_columns" => nil,
|
||||
"ignore_routes" => nil,
|
||||
"ignore_unknown_models" => "false",
|
||||
"hide_limit_column_types" => "integer,bigint,boolean",
|
||||
"hide_default_column_types" => "json,jsonb,hstore",
|
||||
"skip_on_db_migrate" => "false",
|
||||
"format_bare" => "true",
|
||||
"format_rdoc" => "false",
|
||||
"format_yard" => "false",
|
||||
"format_markdown" => "false",
|
||||
"sort" => "false",
|
||||
"force" => "false",
|
||||
"frozen" => "false",
|
||||
"classified_sort" => "true",
|
||||
"trace" => "false",
|
||||
"wrapper_open" => nil,
|
||||
"wrapper_close" => nil,
|
||||
"with_comment" => "true"
|
||||
)
|
||||
end
|
||||
|
||||
Annotate.load_tasks
|
||||
end
|
||||
@@ -1,4 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: admin_users
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# email :string default(""), not null
|
||||
# encrypted_password :string default(""), not null
|
||||
# remember_created_at :datetime
|
||||
# reset_password_sent_at :datetime
|
||||
# reset_password_token :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_admin_users_on_email (email) UNIQUE
|
||||
# index_admin_users_on_reset_password_token (reset_password_token) UNIQUE
|
||||
#
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe(AdminUser, type: :model) do
|
||||
|
||||
Reference in New Issue
Block a user