1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-25 08:09:38 +02:00

Initial commit

This commit is contained in:
Josh Pigford 2024-02-02 09:05:04 -06:00
commit 99de24ac70
147 changed files with 3519 additions and 0 deletions

3
app/models/account.rb Normal file
View file

@ -0,0 +1,3 @@
class Account < ApplicationRecord
belongs_to :family
end

View file

@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
end

View file

3
app/models/current.rb Normal file
View file

@ -0,0 +1,3 @@
class Current < ActiveSupport::CurrentAttributes
attribute :user
end

4
app/models/family.rb Normal file
View file

@ -0,0 +1,4 @@
class Family < ApplicationRecord
has_many :users, dependent: :destroy
has_many :accounts, dependent: :destroy
end

12
app/models/user.rb Normal file
View file

@ -0,0 +1,12 @@
class User < ApplicationRecord
has_secure_password
belongs_to :family
validates :email, presence: true, uniqueness: true
normalizes :email, with: -> (email) { email.strip.downcase }
generates_token_for :password_reset, expires_in: 15.minutes do
password_salt&.last(10)
end
end