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:
commit
99de24ac70
147 changed files with 3519 additions and 0 deletions
3
app/models/account.rb
Normal file
3
app/models/account.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Account < ApplicationRecord
|
||||
belongs_to :family
|
||||
end
|
3
app/models/application_record.rb
Normal file
3
app/models/application_record.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class ApplicationRecord < ActiveRecord::Base
|
||||
primary_abstract_class
|
||||
end
|
0
app/models/concerns/.keep
Normal file
0
app/models/concerns/.keep
Normal file
3
app/models/current.rb
Normal file
3
app/models/current.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Current < ActiveSupport::CurrentAttributes
|
||||
attribute :user
|
||||
end
|
4
app/models/family.rb
Normal file
4
app/models/family.rb
Normal 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
12
app/models/user.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue