Alias the user creation_time column

This allows rails to set the created_at automatically, and so avoids
us from having to do so in a callback. It also hides the unusual
db column name from the rest of the app.
This commit is contained in:
Andy Allan 2021-12-22 14:48:07 +00:00
parent bf5f2890ac
commit 40e8482825
5 changed files with 9 additions and 12 deletions

View file

@ -1,7 +1,7 @@
json.user do
json.id user.id
json.display_name user.display_name
json.account_created user.creation_time.xmlschema
json.account_created user.created_at.xmlschema
json.description user.description if user.description
if current_user && current_user == user && can?(:details, User)

View file

@ -1,6 +1,6 @@
xml.tag! "user", :id => user.id,
:display_name => user.display_name,
:account_created => user.creation_time.xmlschema do
:account_created => user.created_at.xmlschema do
xml.tag! "description", user.description if user.description
if current_user && current_user == user && can?(:details, User)
xml.tag! "contributor-terms", :agreed => user.terms_agreed.present?,