mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
Add presence validations for required fields (#545)
* Adds basic validations for required fields Also deletes a few extraneous .keep files Does not add the family_id required field for user, since that breaks the basic test setup * Restore keep files to this branch * Remove Credit model and validate models behind ids * Restore concerns .keep
This commit is contained in:
parent
a4c97a9d52
commit
e5750d1a13
6 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,8 @@ class Transaction::Category < ApplicationRecord
|
|||
has_many :transactions
|
||||
belongs_to :family
|
||||
|
||||
validates :name, :color, :family, presence: true
|
||||
|
||||
before_update :clear_internal_category, if: :name_changed?
|
||||
|
||||
DEFAULT_CATEGORIES = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue