-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
6c48f2e
commit bab9d66
Showing
11 changed files
with
140 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12.16.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class AccountPolicy < ApplicationPolicy | ||
def show? | ||
# FIXME : temporary hack to transition over to multiple accounts per user | ||
# We should be fetching the current account user relationship here. | ||
@user.administrator? | ||
end | ||
|
||
def update? | ||
# FIXME : temporary hack to transition over to multiple accounts per user | ||
# We should be fetching the current account user relationship here. | ||
@user.administrator? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
json.id @account.id | ||
json.name @account.name | ||
json.locale @account.locale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
json.id @account.id | ||
json.name @account.name | ||
json.locale @account.locale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Based on ISO_639-3 Codes. ref: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes | ||
# This Hash is used in account model, so do not change the index for existing languages | ||
|
||
LANGUAGES_CONFIG = { | ||
0 => { name: 'English', iso_639_3_code: 'eng' }, | ||
1 => { name: 'Arabic', iso_639_3_code: 'ara' }, | ||
2 => { name: 'Dutch', iso_639_3_code: 'nld' }, | ||
3 => { name: 'French', iso_639_3_code: 'fra' }, | ||
4 => { name: 'German', iso_639_3_code: 'deu' }, | ||
5 => { name: 'Hindi', iso_639_3_code: 'hin' }, | ||
6 => { name: 'Italian', iso_639_3_code: 'ita' }, | ||
7 => { name: 'Japanese', iso_639_3_code: 'jpn' }, | ||
8 => { name: 'Korean', iso_639_3_code: 'kor' }, | ||
9 => { name: 'Portugues', iso_639_3_code: 'por' }, | ||
10 => { name: 'Russian', iso_639_3_code: 'rus' }, | ||
11 => { name: 'Chinese', iso_639_3_code: 'zho' }, | ||
12 => { name: 'Spanish', iso_639_3_code: 'spa' } | ||
}.freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddLocaleToAccount < ActiveRecord::Migration[6.0] | ||
def change | ||
add_column :accounts, :locale, :integer, default: 0 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters