mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-27 17:19:39 +02:00
Merge branch 'main' of https://github.com/maybe-finance/maybe
This commit is contained in:
commit
dbc76c76ef
5 changed files with 13 additions and 8 deletions
|
@ -37,6 +37,8 @@ You'll need:
|
||||||
- ruby >3 (specific version is in `Gemfile`)
|
- ruby >3 (specific version is in `Gemfile`)
|
||||||
- postgresql (if using stock `config/database.yml`)
|
- postgresql (if using stock `config/database.yml`)
|
||||||
|
|
||||||
|
For convenience, the project contains configuration for a devcontainer. Open up the project in your editor that supports devcontainers and run the commands mentioned below.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cd maybe
|
cd maybe
|
||||||
bundle install
|
bundle install
|
||||||
|
@ -69,7 +71,7 @@ If you've got feature ideas, simply [open a new issues](https://github.com/maybe
|
||||||
|
|
||||||
## Repo Activity
|
## Repo Activity
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Copyright & license
|
## Copyright & license
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,10 @@ class AccountsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def account_type_class
|
def account_type_class
|
||||||
params[:type].constantize
|
if params[:type].present? && Account::VALID_ACCOUNT_TYPES.include?(params[:type])
|
||||||
rescue
|
params[:type].constantizes
|
||||||
Account # Default to Account if type is not provided or invalid
|
else
|
||||||
|
Account # Default to Account if type is not provided or invalid
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,4 +2,5 @@ class Account < ApplicationRecord
|
||||||
belongs_to :family
|
belongs_to :family
|
||||||
|
|
||||||
scope :depository, -> { where(type: 'Depository') }
|
scope :depository, -> { where(type: 'Depository') }
|
||||||
|
VALID_ACCOUNT_TYPES = %w[Investment Depository Credit Loan Property Vehicle OtherAsset OtherLiability].freeze
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
class Depository < Account
|
class Depository < Account
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,9 +6,9 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
resources :accounts
|
resources :accounts
|
||||||
|
|
||||||
scope 'accounts/new' do
|
scope "accounts/new" do
|
||||||
scope 'bank' do
|
scope "bank" do
|
||||||
get '', to: 'accounts#new_bank', as: 'new_bank'
|
get "", to: "accounts#new_bank", as: "new_bank"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue