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:
parent
bf5f2890ac
commit
40e8482825
5 changed files with 9 additions and 12 deletions
|
@ -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)
|
||||
|
|
|
@ -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?,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue