One of my models (Ot) belongs_to a Workflow model. In the general view, the Workflow column appears to be null for all of my Ots. This Workflow model doesn't have a name
column, so I'm thinking that that's the cause of the issue.
or maybe a better solution would be to configure the model itself so it has a display name for every column in every resource.
I shaved off most of the tables in this schema for simplicity, since they weren't involved in this particular problem. Still kept all motor admin tables and the ot/workflow tables
ActiveRecord::Schema.define(version: 2021_06_05_191603) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "active_admin_comments", force: :cascade do |t|
t.string "namespace"
t.text "body"
t.string "resource_type"
t.bigint "resource_id"
t.string "author_type"
t.bigint "author_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id"
t.index ["namespace"], name: "index_active_admin_comments_on_namespace"
t.index ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id"
end
create_table "admin_users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["email"], name: "index_admin_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
end
create_table "categories", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.integer "renewal_leeway_days", default: 90, null: false
end
create_table "clients", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "name_short"
t.string "name_tad"
t.json "address"
t.string "cuit"
t.string "importer_number"
t.json "apoderado"
t.string "rump"
t.json "contact_info"
t.integer "pay_condition"
end
create_table "motor_alert_locks", force: :cascade do |t|
t.bigint "alert_id", null: false
t.string "lock_timestamp", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["alert_id", "lock_timestamp"], name: "index_motor_alert_locks_on_alert_id_and_lock_timestamp", unique: true
t.index ["alert_id"], name: "index_motor_alert_locks_on_alert_id"
end
create_table "motor_alerts", force: :cascade do |t|
t.bigint "query_id", null: false
t.string "name", null: false
t.text "description"
t.text "to_emails", null: false
t.boolean "is_enabled", default: true, null: false
t.text "preferences", null: false
t.bigint "author_id"
t.string "author_type"
t.datetime "deleted_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["name"], name: "motor_alerts_name_unique_index", unique: true, where: "(deleted_at IS NULL)"
t.index ["query_id"], name: "index_motor_alerts_on_query_id"
t.index ["updated_at"], name: "index_motor_alerts_on_updated_at"
end
create_table "motor_audits", force: :cascade do |t|
t.bigint "auditable_id"
t.string "auditable_type"
t.bigint "associated_id"
t.string "associated_type"
t.bigint "user_id"
t.string "user_type"
t.string "username"
t.string "action"
t.text "audited_changes"
t.bigint "version", default: 0
t.text "comment"
t.string "remote_address"
t.string "request_uuid"
t.datetime "created_at"
t.index ["associated_type", "associated_id"], name: "motor_auditable_associated_index"
t.index ["auditable_type", "auditable_id", "version"], name: "motor_auditable_index"
t.index ["created_at"], name: "index_motor_audits_on_created_at"
t.index ["request_uuid"], name: "index_motor_audits_on_request_uuid"
t.index ["user_id", "user_type"], name: "motor_auditable_user_index"
end
create_table "motor_configs", force: :cascade do |t|
t.string "key", null: false
t.text "value", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["key"], name: "index_motor_configs_on_key", unique: true
t.index ["updated_at"], name: "index_motor_configs_on_updated_at"
end
create_table "motor_dashboards", force: :cascade do |t|
t.string "title", null: false
t.text "description"
t.text "preferences", null: false
t.bigint "author_id"
t.string "author_type"
t.datetime "deleted_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["title"], name: "motor_dashboards_title_unique_index", unique: true, where: "(deleted_at IS NULL)"
t.index ["updated_at"], name: "index_motor_dashboards_on_updated_at"
end
create_table "motor_forms", force: :cascade do |t|
t.string "name", null: false
t.text "description"
t.text "api_path", null: false
t.string "http_method", null: false
t.text "preferences", null: false
t.bigint "author_id"
t.string "author_type"
t.datetime "deleted_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["name"], name: "motor_forms_name_unique_index", unique: true, where: "(deleted_at IS NULL)"
t.index ["updated_at"], name: "index_motor_forms_on_updated_at"
end
create_table "motor_queries", force: :cascade do |t|
t.string "name", null: false
t.text "description"
t.text "sql_body", null: false
t.text "preferences", null: false
t.bigint "author_id"
t.string "author_type"
t.datetime "deleted_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["name"], name: "motor_queries_name_unique_index", unique: true, where: "(deleted_at IS NULL)"
t.index ["updated_at"], name: "index_motor_queries_on_updated_at"
end
create_table "motor_resources", force: :cascade do |t|
t.string "name", null: false
t.text "preferences", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["name"], name: "index_motor_resources_on_name", unique: true
t.index ["updated_at"], name: "index_motor_resources_on_updated_at"
end
create_table "motor_taggable_tags", force: :cascade do |t|
t.bigint "tag_id", null: false
t.bigint "taggable_id", null: false
t.string "taggable_type", null: false
t.index ["tag_id"], name: "index_motor_taggable_tags_on_tag_id"
t.index ["taggable_id", "taggable_type", "tag_id"], name: "motor_polymorphic_association_tag_index", unique: true
end
create_table "motor_tags", force: :cascade do |t|
t.string "name", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["name"], name: "motor_tags_name_unique_index", unique: true
end
create_table "ot_events", force: :cascade do |t|
t.bigint "status_id", null: false
t.bigint "ot_id", null: false
t.date "date", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "document_id"
t.integer "order", default: 0, null: false
t.index ["document_id"], name: "index_ot_events_on_document_id"
t.index ["ot_id"], name: "index_ot_events_on_ot_id"
t.index ["status_id"], name: "index_ot_events_on_status_id"
end
create_table "ots", force: :cascade do |t|
t.bigint "workflow_id", null: false
t.bigint "client_id", null: false
t.bigint "importer_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "name"
t.index ["client_id"], name: "index_ots_on_client_id"
t.index ["importer_id"], name: "index_ots_on_importer_id"
t.index ["workflow_id"], name: "index_ots_on_workflow_id"
end
create_table "status_categories", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "documentable_type"
end
create_table "status_workflow_links", force: :cascade do |t|
t.bigint "workflow_subtype_id", null: false
t.bigint "status_category_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["status_category_id"], name: "index_status_workflow_links_on_status_category_id"
t.index ["workflow_subtype_id"], name: "index_status_workflow_links_on_workflow_subtype_id"
end
create_table "statuses", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "status_category_id"
t.index ["status_category_id"], name: "index_statuses_on_status_category_id"
end
create_table "workflow_subtypes", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "workflow_types", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "workflows", force: :cascade do |t|
t.bigint "category_id", null: false
t.bigint "workflow_type_id"
t.bigint "workflow_subtype_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["category_id"], name: "index_workflows_on_category_id"
t.index ["workflow_subtype_id"], name: "index_workflows_on_workflow_subtype_id"
t.index ["workflow_type_id"], name: "index_workflows_on_workflow_type_id"
end
end