diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 835edb8b..1554ab84 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -2,38 +2,39 @@ class AccountsController < ApplicationController before_action :authenticate_user! def new - end - - def new_bank - @account = Depository.new - end - - def new_credit - @account = Credit.new + if params[:type].blank? || Account.accountable_types.include?("Account::#{params[:type]}") + @account = if params[:type].blank? + Account.new + else + Account.new(accountable_type: "Account::#{params[:type]}") + end + else + head :not_found + end end def show end def create - @account = account_type_class.new(account_params) - @account.family = current_family + @account = Account.new(account_params.merge(family: current_family)) + @account.accountable = account_params[:accountable_type].constantize.new if @account.save - redirect_to root_path + redirect_to accounts_path, notice: "New account created successfully" else - render :new + render "new", status: :unprocessable_entity end end private def account_params - params.require(:account).permit(:name, :balance, :type, :subtype) + params.require(:account).permit(:name, :accountable_type, :balance, :subtype) end def account_type_class - if params[:type].present? && Account::VALID_ACCOUNT_TYPES.include?(params[:type]) + if params[:type].present? && Account.accountable_types.include?(params[:type]) params[:type].constantizes else Account # Default to Account if type is not provided or invalid diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c7719bd9..bd65adc7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -6,4 +6,8 @@ module ApplicationHelper def header_title(page_title) content_for(:header_title) { page_title } end + + def permitted_accountable_partial(name) + name.underscore + end end diff --git a/app/models/account.rb b/app/models/account.rb index 0c34c0b3..63bfe8d3 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,7 +1,14 @@ class Account < ApplicationRecord - VALID_ACCOUNT_TYPES = %w[Investment Depository Credit Loan Property Vehicle OtherAsset OtherLiability].freeze - belongs_to :family - scope :depository, -> { where(type: "Depository") } + delegated_type :accountable, types: %w[ Account::Credit Account::Depository Account::Investment Account::Loan Account::OtherAsset Account::OtherLiability Account::Property Account::Vehicle], dependent: :destroy + + delegate :icon, :type_name, :color, to: :accountable + + # Class method to get a representative instance of each accountable type + def self.accountable_type_instances + accountable_types.map do |type| + type.constantize.new + end + end end diff --git a/app/models/account/credit.rb b/app/models/account/credit.rb new file mode 100644 index 00000000..8dbdc745 --- /dev/null +++ b/app/models/account/credit.rb @@ -0,0 +1,18 @@ +class Account::Credit < ApplicationRecord + include Accountable + + def icon + "icon-credit-card.svg" + end + + def type_name + "Credit Card" + end + + def color + { + background: "bg-[#E6F6FA]", + text: "text-[#189FC7]" + } + end +end diff --git a/app/models/account/depository.rb b/app/models/account/depository.rb new file mode 100644 index 00000000..5f4c9fd6 --- /dev/null +++ b/app/models/account/depository.rb @@ -0,0 +1,18 @@ +class Account::Depository < ApplicationRecord + include Accountable + + def icon + "icon-bank-accounts.svg" + end + + def type_name + "Bank Accounts" + end + + def color + { + background: "bg-[#EAF4FF]", + text: "text-[#3492FB]" + } + end +end diff --git a/app/models/account/investment.rb b/app/models/account/investment.rb new file mode 100644 index 00000000..ae3da945 --- /dev/null +++ b/app/models/account/investment.rb @@ -0,0 +1,18 @@ +class Account::Investment < ApplicationRecord + include Accountable + + def icon + "icon-bank-accounts.svg" + end + + def type_name + "Investments" + end + + def color + { + background: "bg-[#EDF7F4]", + text: "text-[#1BD5A1]" + } + end +end diff --git a/app/models/account/loan.rb b/app/models/account/loan.rb new file mode 100644 index 00000000..ba8cd645 --- /dev/null +++ b/app/models/account/loan.rb @@ -0,0 +1,18 @@ +class Account::Loan < ApplicationRecord + include Accountable + + def icon + "icon-bank-accounts.svg" + end + + def type_name + "Loan" + end + + def color + { + background: "bg-[#EDF7F4]", + text: "text-[#1BD5A1]" + } + end +end diff --git a/app/models/account/other_asset.rb b/app/models/account/other_asset.rb new file mode 100644 index 00000000..e00c9f51 --- /dev/null +++ b/app/models/account/other_asset.rb @@ -0,0 +1,18 @@ +class Account::OtherAsset < ApplicationRecord + include Accountable + + def icon + "icon-bank-accounts.svg" + end + + def type_name + "Other Asset" + end + + def color + { + background: "bg-[#EDF7F4]", + text: "text-[#1BD5A1]" + } + end +end diff --git a/app/models/account/other_liability.rb b/app/models/account/other_liability.rb new file mode 100644 index 00000000..c9c51ead --- /dev/null +++ b/app/models/account/other_liability.rb @@ -0,0 +1,18 @@ +class Account::OtherLiability < ApplicationRecord + include Accountable + + def icon + "icon-bank-accounts.svg" + end + + def type_name + "Other Liability" + end + + def color + { + background: "bg-[#EDF7F4]", + text: "text-[#1BD5A1]" + } + end +end diff --git a/app/models/account/property.rb b/app/models/account/property.rb new file mode 100644 index 00000000..105ac600 --- /dev/null +++ b/app/models/account/property.rb @@ -0,0 +1,18 @@ +class Account::Property < ApplicationRecord + include Accountable + + def icon + "icon-real-estate.svg" + end + + def type_name + "Real Estate" + end + + def color + { + background: "bg-[#FEF0F7]", + text: "text-[#F03695]" + } + end +end diff --git a/app/models/account/vehicle.rb b/app/models/account/vehicle.rb new file mode 100644 index 00000000..6a43f4a6 --- /dev/null +++ b/app/models/account/vehicle.rb @@ -0,0 +1,18 @@ +class Account::Vehicle < ApplicationRecord + include Accountable + + def icon + "icon-bank-accounts.svg" + end + + def type_name + "Vehicle" + end + + def color + { + background: "bg-[#EDF7F4]", + text: "text-[#1BD5A1]" + } + end +end diff --git a/app/models/concerns/accountable.rb b/app/models/concerns/accountable.rb new file mode 100644 index 00000000..11ec8f24 --- /dev/null +++ b/app/models/concerns/accountable.rb @@ -0,0 +1,7 @@ +module Accountable + extend ActiveSupport::Concern + + included do + has_one :account, as: :accountable, touch: true + end +end diff --git a/app/models/depository.rb b/app/models/depository.rb deleted file mode 100644 index bacbb9e6..00000000 --- a/app/models/depository.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Depository < Account -end diff --git a/app/views/accounts/_account_type.html.erb b/app/views/accounts/_account_type.html.erb new file mode 100644 index 00000000..6d654ce9 --- /dev/null +++ b/app/views/accounts/_account_type.html.erb @@ -0,0 +1,9 @@ +
+ <%= link_to new_account_path(type: account_type.class.name.demodulize), class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %> + + + <%= inline_svg_tag(account_type.icon, class: "#{account_type.color[:text]} stroke-current") %> + + <%= account_type.type_name %> + <% end %> +
diff --git a/app/views/accounts/account/_credit.html.erb b/app/views/accounts/account/_credit.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/accounts/account/_depository.html.erb b/app/views/accounts/account/_depository.html.erb new file mode 100644 index 00000000..11933f8d --- /dev/null +++ b/app/views/accounts/account/_depository.html.erb @@ -0,0 +1,4 @@ +
+ + <%= f.select :subtype, options_for_select([["Checking", "checking"], ["Savings", "savings"]], selected: ""), {}, class: "block w-full p-0 mt-1 bg-transparent border-none focus:outline-none focus:ring-0" %> +
diff --git a/app/views/accounts/account/_investment.html.erb b/app/views/accounts/account/_investment.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/accounts/account/_loan.html.erb b/app/views/accounts/account/_loan.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/accounts/account/_other_asset.html.erb b/app/views/accounts/account/_other_asset.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/accounts/account/_other_liability.html.erb b/app/views/accounts/account/_other_liability.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/accounts/account/_property.html.erb b/app/views/accounts/account/_property.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/accounts/account/_vehicle.html.erb b/app/views/accounts/account/_vehicle.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/accounts/index.html.erb b/app/views/accounts/index.html.erb new file mode 100644 index 00000000..8e067a3c --- /dev/null +++ b/app/views/accounts/index.html.erb @@ -0,0 +1,17 @@ + +

Cash

+

<%#= number_to_currency current_family.cash_balance %>

+ +<% current_family.accounts.each do |account| %> +
+
+ <%= account.name %> +
+
+ <%= account.accountable %> +
+

+ <%= number_to_currency account.balance %> +

+
+<% end %> diff --git a/app/views/accounts/new.html.erb b/app/views/accounts/new.html.erb index 928767b8..a222244b 100644 --- a/app/views/accounts/new.html.erb +++ b/app/views/accounts/new.html.erb @@ -1,43 +1,39 @@

Add an account

-
-
- <%= link_to new_bank_path, class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %> - - - <%= inline_svg_tag('icon-bank-accounts.svg', class: 'text-[#3492FB] stroke-current') %> - - Bank accounts - <% end %> +<% if params[:type].blank? || Account.accountable_types.include?("Account::#{params[:type]}") == false %> +
+ <%= render partial: "account_type", collection: Account.accountable_type_instances %> +
+<% else %> +
+ <%= link_to new_account_path, class: "" do %> + <%= inline_svg_tag('icon-arrow-left.svg', class: 'text-gray-500 fill-current') %> + <% end %> +

Enter <%= params[:type] %> account

-
- <%= link_to new_credit_path, class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %> - - - <%= inline_svg_tag('icon-credit-card.svg', class: 'text-[#189FC7] stroke-current') %> - - Credit cards - <% end %> -
+ <%= form_with model: @account, url: accounts_path, scope: :account, html: { class: "space-y-4" } do |f| %> + <%= f.hidden_field :accountable_type %> -
- <%= link_to "new_investment_path", class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %> - - - <%= inline_svg_tag('icon-investments.svg', class: 'text-[#1BD5A1] stroke-current') %> - - Investments - <% end %> -
+
+ <%# Optional %> + + <%= f.text_field :name, placeholder: "Account name", required: 'required', class: "p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100" %> +
-
- <%= link_to "new_real_estate_path", class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %> - - - <%= inline_svg_tag('icon-real-estate.svg', class: 'text-[#F03695] stroke-current') %> - - Real estate - <% end %> -
-
\ No newline at end of file + <%= render "accounts/#{permitted_accountable_partial(@account.accountable_type)}", f: f %> + +
+ +
+ <%= f.number_field :balance, placeholder: "$0.00", in: 0.00..100000000.00, required: 'required', class: "p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100" %> +
+
+ +
+ +
+ <% end %> +<% end %> diff --git a/app/views/accounts/new_bank.html.erb b/app/views/accounts/new_bank.html.erb deleted file mode 100644 index efd5e7f9..00000000 --- a/app/views/accounts/new_bank.html.erb +++ /dev/null @@ -1,34 +0,0 @@ -
- <%= link_to new_account_path, class: "" do %> - <%= inline_svg_tag('icon-arrow-left.svg', class: 'text-gray-500 fill-current') %> - <% end %> -

Enter bank account

-
- -<%= form_with model: @account, url: accounts_path, scope: :account, html: { class: "space-y-4" } do |f| %> - <%= f.hidden_field :type, value: "Depository" %> - -
- <%# Optional %> - - <%= f.text_field :name, placeholder: "Account name", required: 'required', class: "p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100" %> -
- -
- - <%= f.select :subtype, options_for_select([["Checking", "checking"], ["Savings", "savings"]], selected: ""), {}, class: "block w-full p-0 mt-1 bg-transparent border-none focus:outline-none focus:ring-0" %> -
- -
- -
- <%= f.number_field :balance, placeholder: "$0.00", in: 0.00..100000000.00, required: 'required', class: "p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100" %> -
-
- -
- -
-<% end %> \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ba49490e..59d4379d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -63,7 +63,7 @@

Cash

- <% 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