- <% current_family.accounts.depository.each do |account| %>
+ <% current_family.accounts.each do |account| %>
<%= account.name %>
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 3043d036..e24469ff 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -79,4 +79,7 @@ Rails.application.configure do
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
config.generators.apply_rubocop_autocorrect_after_generate!
+
+ # Allow connection from any host in development
+ config.hosts = nil
end
diff --git a/config/tailwind.config.js b/config/tailwind.config.js
index 4850d1b4..5618c738 100644
--- a/config/tailwind.config.js
+++ b/config/tailwind.config.js
@@ -4,6 +4,7 @@ module.exports = {
content: [
'./public/*.html',
'./app/helpers/**/*.rb',
+ './app/models/**/*.rb',
'./app/javascript/**/*.js',
'./app/views/**/*.{erb,haml,html,slim}'
],
diff --git a/db/migrate/20240202191425_create_account_loans.rb b/db/migrate/20240202191425_create_account_loans.rb
new file mode 100644
index 00000000..6f2cc760
--- /dev/null
+++ b/db/migrate/20240202191425_create_account_loans.rb
@@ -0,0 +1,7 @@
+class CreateAccountLoans < ActiveRecord::Migration[7.2]
+ def change
+ create_table :account_loans, id: :uuid do |t|
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20240202191746_add_accountable_to_account.rb b/db/migrate/20240202191746_add_accountable_to_account.rb
new file mode 100644
index 00000000..7e06b200
--- /dev/null
+++ b/db/migrate/20240202191746_add_accountable_to_account.rb
@@ -0,0 +1,7 @@
+class AddAccountableToAccount < ActiveRecord::Migration[7.2]
+ def change
+ add_column :accounts, :accountable_type, :string
+ add_column :accounts, :accountable_id, :uuid
+ add_index :accounts, :accountable_type
+ end
+end
diff --git a/db/migrate/20240202192214_create_account_depositories.rb b/db/migrate/20240202192214_create_account_depositories.rb
new file mode 100644
index 00000000..2d8548cb
--- /dev/null
+++ b/db/migrate/20240202192214_create_account_depositories.rb
@@ -0,0 +1,7 @@
+class CreateAccountDepositories < ActiveRecord::Migration[7.2]
+ def change
+ create_table :account_depositories, id: :uuid do |t|
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20240202192231_create_account_credits.rb b/db/migrate/20240202192231_create_account_credits.rb
new file mode 100644
index 00000000..221d4d8a
--- /dev/null
+++ b/db/migrate/20240202192231_create_account_credits.rb
@@ -0,0 +1,7 @@
+class CreateAccountCredits < ActiveRecord::Migration[7.2]
+ def change
+ create_table :account_credits, id: :uuid do |t|
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20240202192238_create_account_investments.rb b/db/migrate/20240202192238_create_account_investments.rb
new file mode 100644
index 00000000..a616ee58
--- /dev/null
+++ b/db/migrate/20240202192238_create_account_investments.rb
@@ -0,0 +1,7 @@
+class CreateAccountInvestments < ActiveRecord::Migration[7.2]
+ def change
+ create_table :account_investments, id: :uuid do |t|
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20240202192312_create_account_properties.rb b/db/migrate/20240202192312_create_account_properties.rb
new file mode 100644
index 00000000..1d44b4c7
--- /dev/null
+++ b/db/migrate/20240202192312_create_account_properties.rb
@@ -0,0 +1,7 @@
+class CreateAccountProperties < ActiveRecord::Migration[7.2]
+ def change
+ create_table :account_properties, id: :uuid do |t|
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20240202192319_create_account_vehicles.rb b/db/migrate/20240202192319_create_account_vehicles.rb
new file mode 100644
index 00000000..712ac6d6
--- /dev/null
+++ b/db/migrate/20240202192319_create_account_vehicles.rb
@@ -0,0 +1,7 @@
+class CreateAccountVehicles < ActiveRecord::Migration[7.2]
+ def change
+ create_table :account_vehicles, id: :uuid do |t|
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20240202192327_create_account_other_assets.rb b/db/migrate/20240202192327_create_account_other_assets.rb
new file mode 100644
index 00000000..e37ddcf6
--- /dev/null
+++ b/db/migrate/20240202192327_create_account_other_assets.rb
@@ -0,0 +1,7 @@
+class CreateAccountOtherAssets < ActiveRecord::Migration[7.2]
+ def change
+ create_table :account_other_assets, id: :uuid do |t|
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20240202192333_create_account_other_liabilities.rb b/db/migrate/20240202192333_create_account_other_liabilities.rb
new file mode 100644
index 00000000..dd37e4c5
--- /dev/null
+++ b/db/migrate/20240202192333_create_account_other_liabilities.rb
@@ -0,0 +1,7 @@
+class CreateAccountOtherLiabilities < ActiveRecord::Migration[7.2]
+ def change
+ create_table :account_other_liabilities, id: :uuid do |t|
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20240203030754_remove_type_from_accounts.rb b/db/migrate/20240203030754_remove_type_from_accounts.rb
new file mode 100644
index 00000000..27348f9f
--- /dev/null
+++ b/db/migrate/20240203030754_remove_type_from_accounts.rb
@@ -0,0 +1,5 @@
+class RemoveTypeFromAccounts < ActiveRecord::Migration[7.2]
+ def change
+ remove_column :accounts, :type
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 1a132587..ce7d581a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,13 +10,52 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.2].define(version: 2024_02_02_230325) do
+ActiveRecord::Schema[7.2].define(version: 2024_02_03_030754) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
+ create_table "account_credits", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "account_depositories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "account_investments", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "account_loans", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "account_other_assets", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "account_other_liabilities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "account_properties", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "account_vehicles", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
create_table "accounts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
- t.string "type"
t.string "subtype"
t.uuid "family_id", null: false
t.string "name"
@@ -24,8 +63,10 @@ ActiveRecord::Schema[7.2].define(version: 2024_02_02_230325) do
t.string "currency", default: "USD"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+ t.string "accountable_type"
+ t.uuid "accountable_id"
+ t.index ["accountable_type"], name: "index_accounts_on_accountable_type"
t.index ["family_id"], name: "index_accounts_on_family_id"
- t.index ["type"], name: "index_accounts_on_type"
end
create_table "families", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
diff --git a/test/fixtures/account/credits.yml b/test/fixtures/account/credits.yml
new file mode 100644
index 00000000..d7a33292
--- /dev/null
+++ b/test/fixtures/account/credits.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the "{}" from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/account/depositories.yml b/test/fixtures/account/depositories.yml
new file mode 100644
index 00000000..d7a33292
--- /dev/null
+++ b/test/fixtures/account/depositories.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the "{}" from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/account/investments.yml b/test/fixtures/account/investments.yml
new file mode 100644
index 00000000..d7a33292
--- /dev/null
+++ b/test/fixtures/account/investments.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the "{}" from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/account/loans.yml b/test/fixtures/account/loans.yml
new file mode 100644
index 00000000..d7a33292
--- /dev/null
+++ b/test/fixtures/account/loans.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the "{}" from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/account/other_assets.yml b/test/fixtures/account/other_assets.yml
new file mode 100644
index 00000000..d7a33292
--- /dev/null
+++ b/test/fixtures/account/other_assets.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the "{}" from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/account/other_liabilities.yml b/test/fixtures/account/other_liabilities.yml
new file mode 100644
index 00000000..d7a33292
--- /dev/null
+++ b/test/fixtures/account/other_liabilities.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the "{}" from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/account/properties.yml b/test/fixtures/account/properties.yml
new file mode 100644
index 00000000..d7a33292
--- /dev/null
+++ b/test/fixtures/account/properties.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the "{}" from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/account/vehicles.yml b/test/fixtures/account/vehicles.yml
new file mode 100644
index 00000000..d7a33292
--- /dev/null
+++ b/test/fixtures/account/vehicles.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the "{}" from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/fixtures/accounts.yml b/test/fixtures/accounts.yml
index aa863be0..2ee283d9 100644
--- a/test/fixtures/accounts.yml
+++ b/test/fixtures/accounts.yml
@@ -1,13 +1,11 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
- type:
family: one
name: MyString
- balance:
+ balance:
two:
- type:
family: two
name: MyString
- balance:
+ balance:
diff --git a/test/models/account/credit_test.rb b/test/models/account/credit_test.rb
new file mode 100644
index 00000000..1c8fd636
--- /dev/null
+++ b/test/models/account/credit_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class Account::CreditTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/account/depository_test.rb b/test/models/account/depository_test.rb
new file mode 100644
index 00000000..d93cf1cd
--- /dev/null
+++ b/test/models/account/depository_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class Account::DepositoryTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/account/investment_test.rb b/test/models/account/investment_test.rb
new file mode 100644
index 00000000..1ed2b6ba
--- /dev/null
+++ b/test/models/account/investment_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class Account::InvestmentTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/account/loan_test.rb b/test/models/account/loan_test.rb
new file mode 100644
index 00000000..e793470a
--- /dev/null
+++ b/test/models/account/loan_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class Account::LoanTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/account/other_asset_test.rb b/test/models/account/other_asset_test.rb
new file mode 100644
index 00000000..d65911f5
--- /dev/null
+++ b/test/models/account/other_asset_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class Account::OtherAssetTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/account/other_liability_test.rb b/test/models/account/other_liability_test.rb
new file mode 100644
index 00000000..4c682491
--- /dev/null
+++ b/test/models/account/other_liability_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class Account::OtherLiabilityTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/account/property_test.rb b/test/models/account/property_test.rb
new file mode 100644
index 00000000..34f6fb71
--- /dev/null
+++ b/test/models/account/property_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class Account::PropertyTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/models/account/vehicle_test.rb b/test/models/account/vehicle_test.rb
new file mode 100644
index 00000000..011d99f5
--- /dev/null
+++ b/test/models/account/vehicle_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class Account::VehicleTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end