diff --git a/app/models/server.rb b/app/models/server.rb index 557cdff1..fd23c4e5 100644 --- a/app/models/server.rb +++ b/app/models/server.rb @@ -5,33 +5,34 @@ # Table name: servers # # id :integer not null, primary key -# organization_id :integer -# uuid :string(255) -# name :string(255) -# mode :string(255) -# ip_pool_id :integer -# created_at :datetime -# updated_at :datetime -# permalink :string(255) -# send_limit :integer +# allow_sender :boolean default(FALSE) # deleted_at :datetime +# domains_not_to_click_track :text(65535) +# log_smtp_data :boolean default(FALSE) # message_retention_days :integer +# mode :string(255) +# name :string(255) +# outbound_spam_threshold :decimal(8, 2) +# permalink :string(255) +# postmaster_address :string(255) +# privacy_mode :boolean default(FALSE) # raw_message_retention_days :integer # raw_message_retention_size :integer -# allow_sender :boolean default(FALSE) -# token :string(255) +# send_limit :integer # send_limit_approaching_at :datetime # send_limit_approaching_notified_at :datetime # send_limit_exceeded_at :datetime # send_limit_exceeded_notified_at :datetime -# spam_threshold :decimal(8, 2) # spam_failure_threshold :decimal(8, 2) -# postmaster_address :string(255) +# spam_threshold :decimal(8, 2) # suspended_at :datetime -# outbound_spam_threshold :decimal(8, 2) -# domains_not_to_click_track :text(65535) # suspension_reason :string(255) -# log_smtp_data :boolean default(FALSE) +# token :string(255) +# uuid :string(255) +# created_at :datetime +# updated_at :datetime +# ip_pool_id :integer +# organization_id :integer # # Indexes # diff --git a/app/models/statistic.rb b/app/models/statistic.rb index e344ba17..f8b1b0f4 100644 --- a/app/models/statistic.rb +++ b/app/models/statistic.rb @@ -5,9 +5,9 @@ # Table name: statistics # # id :integer not null, primary key -# total_messages :bigint(8) default(0) -# total_outgoing :bigint(8) default(0) -# total_incoming :bigint(8) default(0) +# total_incoming :bigint default(0) +# total_messages :bigint default(0) +# total_outgoing :bigint default(0) # class Statistic < ApplicationRecord diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake index 948f883e..e96283ea 100644 --- a/lib/tasks/auto_annotate_models.rake +++ b/lib/tasks/auto_annotate_models.rake @@ -1,48 +1,57 @@ -# 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 do # You can override any of these by setting an environment variable of the # same name. Annotate.set_defaults( - "routes" => "false", - "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_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", - "ignore_model_sub_dir" => "false", - "ignore_columns" => nil, - "ignore_routes" => nil, - "ignore_unknown_models" => "false", - "hide_limit_column_types" => "integer,boolean", - "skip_on_db_migrate" => "false", - "format_bare" => "true", - "format_rdoc" => "false", - "format_markdown" => "false", - "sort" => "false", - "force" => "false", - "trace" => "false", - "wrapper_open" => nil, - "wrapper_close" => nil + '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 diff --git a/spec/factories/credential_factory.rb b/spec/factories/credential_factory.rb index 5be9e3d6..d243b27c 100644 --- a/spec/factories/credential_factory.rb +++ b/spec/factories/credential_factory.rb @@ -1,5 +1,21 @@ # frozen_string_literal: true +# == Schema Information +# +# Table name: credentials +# +# id :integer not null, primary key +# hold :boolean default(FALSE) +# key :string(255) +# last_used_at :datetime +# name :string(255) +# options :text(65535) +# type :string(255) +# uuid :string(255) +# created_at :datetime +# updated_at :datetime +# server_id :integer +# FactoryBot.define do factory :credential do server diff --git a/spec/factories/http_endpoint_factory.rb b/spec/factories/http_endpoint_factory.rb index 5fec9c8d..cac81f3c 100644 --- a/spec/factories/http_endpoint_factory.rb +++ b/spec/factories/http_endpoint_factory.rb @@ -1,5 +1,25 @@ # frozen_string_literal: true +# == Schema Information +# +# Table name: http_endpoints +# +# id :integer not null, primary key +# disabled_until :datetime +# encoding :string(255) +# error :text(65535) +# format :string(255) +# include_attachments :boolean default(TRUE) +# last_used_at :datetime +# name :string(255) +# strip_replies :boolean default(FALSE) +# timeout :integer +# url :string(255) +# uuid :string(255) +# created_at :datetime +# updated_at :datetime +# server_id :integer +# FactoryBot.define do factory :http_endpoint do server diff --git a/spec/factories/route_factory.rb b/spec/factories/route_factory.rb index 045c4879..47d4b185 100644 --- a/spec/factories/route_factory.rb +++ b/spec/factories/route_factory.rb @@ -1,5 +1,26 @@ # frozen_string_literal: true +# == Schema Information +# +# Table name: routes +# +# id :integer not null, primary key +# endpoint_type :string(255) +# mode :string(255) +# name :string(255) +# spam_mode :string(255) +# token :string(255) +# uuid :string(255) +# created_at :datetime +# updated_at :datetime +# domain_id :integer +# endpoint_id :integer +# server_id :integer +# +# Indexes +# +# index_routes_on_token (token) +# FactoryBot.define do factory :route do name { "test" } diff --git a/spec/factories/server_factory.rb b/spec/factories/server_factory.rb index 3866001a..68d75426 100644 --- a/spec/factories/server_factory.rb +++ b/spec/factories/server_factory.rb @@ -5,33 +5,34 @@ # Table name: servers # # id :integer not null, primary key -# organization_id :integer -# uuid :string(255) -# name :string(255) -# mode :string(255) -# ip_pool_id :integer -# created_at :datetime -# updated_at :datetime -# permalink :string(255) -# send_limit :integer +# allow_sender :boolean default(FALSE) # deleted_at :datetime +# domains_not_to_click_track :text(65535) +# log_smtp_data :boolean default(FALSE) # message_retention_days :integer +# mode :string(255) +# name :string(255) +# outbound_spam_threshold :decimal(8, 2) +# permalink :string(255) +# postmaster_address :string(255) +# privacy_mode :boolean default(FALSE) # raw_message_retention_days :integer # raw_message_retention_size :integer -# allow_sender :boolean default(FALSE) -# token :string(255) +# send_limit :integer # send_limit_approaching_at :datetime # send_limit_approaching_notified_at :datetime # send_limit_exceeded_at :datetime # send_limit_exceeded_notified_at :datetime -# spam_threshold :decimal(8, 2) # spam_failure_threshold :decimal(8, 2) -# postmaster_address :string(255) +# spam_threshold :decimal(8, 2) # suspended_at :datetime -# outbound_spam_threshold :decimal(8, 2) -# domains_not_to_click_track :text(65535) # suspension_reason :string(255) -# log_smtp_data :boolean default(FALSE) +# token :string(255) +# uuid :string(255) +# created_at :datetime +# updated_at :datetime +# ip_pool_id :integer +# organization_id :integer # # Indexes #