create ReportRenderingOptions model

This commit is contained in:
Mohamed ABDELLANI
2022-11-24 10:25:59 +01:00
parent 5cef0e1939
commit b6a7ca3047
4 changed files with 30 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
# frozen_string_literal: true
class ReportRenderingOptions < ApplicationRecord
belongs_to :user, class_name: "Spree::User"
serialize :options, Hash
end

View File

@@ -37,7 +37,7 @@ module Spree
foreign_key: :owner_id, inverse_of: :owner
has_many :customers
has_many :credit_cards
has_many :report_rendering_options, class_name:"::ReportRenderingOptions",dependent: :destroy
accepts_nested_attributes_for :enterprise_roles, allow_destroy: true
accepts_nested_attributes_for :bill_address

View File

@@ -0,0 +1,12 @@
class CreateReportRenderingOptions < ActiveRecord::Migration[6.1]
def change
create_table :report_rendering_options do |t|
t.references :user
t.text :options
t.string :report_type
t.string :report_subtype
t.timestamps
end
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2022_10_07_105052) do
ActiveRecord::Schema.define(version: 2022_11_16_095826) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
@@ -354,6 +354,16 @@ ActiveRecord::Schema.define(version: 2022_10_07_105052) do
t.index ["subscription_id"], name: "index_proxy_orders_on_subscription_id"
end
create_table "report_rendering_options", force: :cascade do |t|
t.bigint "user_id"
t.text "options"
t.string "report_type"
t.string "report_subtype"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["user_id"], name: "index_report_rendering_options_on_user_id"
end
create_table "schedules", id: :serial, force: :cascade do |t|
t.string "name", limit: 255, null: false
t.datetime "created_at", null: false