Feature: API for updating account settings (#645)

* Feature: API for updating account settings

- API to update account locale
- API to update account name
- API to show account info
This commit is contained in:
Sojan Jose
2020-03-29 12:16:31 +05:30
committed by GitHub
parent 6c48f2e789
commit bab9d663d2
11 changed files with 140 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
# Table name: accounts
#
# id :integer not null, primary key
# locale :integer default("English")
# name :string not null
# created_at :datetime not null
# updated_at :datetime not null
@@ -30,6 +31,8 @@ class Account < ApplicationRecord
has_one :subscription, dependent: :destroy
has_many :notification_settings, dependent: :destroy
enum locale: LANGUAGES_CONFIG.map { |key, val| [val[:iso_639_3_code], key] }.to_h
after_create :create_subscription
after_create :notify_creation
after_destroy :notify_deletion