[Git][noosfero/noosfero][master] 2 commits: Fixes article and comment time

Leandro Nunes gitlab at mg.gitlab.com
Mon Jun 19 10:46:01 BRT 2017


Leandro Nunes pushed to branch master at Noosfero / noosfero


Commits:
3b7c91d1 by Evandro Junior at 2017-06-19T07:43:50-03:00
Fixes article and comment time

- - - - -
f583c41f by Leandro Nunes at 2017-06-19T13:45:39+00:00
Merge branch 'fix_article_time' into 'master'

Fixes article and comment time

See merge request !1245
- - - - -


1 changed file:

- app/api/entities.rb


Changes:

=====================================
app/api/entities.rb
=====================================
--- a/app/api/entities.rb
+++ b/app/api/entities.rb
@@ -1,10 +1,6 @@
 module Api
   module Entities
 
-    Entity.format_with :timestamp do |date|
-      date.strftime('%Y/%m/%d %H:%M:%S') if date
-    end
-
     PERMISSIONS = {
       :admin => 0,
       :self  => 10,
@@ -118,8 +114,8 @@ module Api
 
     class Profile < Entity
       expose :identifier, :name, :id
-      expose :created_at, :format_with => :timestamp
-      expose :updated_at, :format_with => :timestamp
+      expose :created_at
+      expose :updated_at
 
       expose :additional_data do |profile, options|
         hash = {}
@@ -197,7 +193,7 @@ module Api
 
     class CommentBase < Entity
       expose :body, :title, :id
-      expose :created_at, :format_with => :timestamp
+      expose :created_at
       expose :author, :using => Profile
       expose :reply_of, :using => CommentBase
       expose :permissions do |comment, options|
@@ -214,8 +210,8 @@ module Api
       expose :id
       expose :body
       expose :abstract, documentation: {type: 'String', desc: 'Teaser of the body'}
-      expose :created_at, :format_with => :timestamp
-      expose :updated_at, :format_with => :timestamp
+      expose :created_at
+      expose :updated_at
       expose :title, :documentation => {:type => "String", :desc => "Title of the article"}
       expose :created_by, :as => :author, :using => Profile, :documentation => {type: 'Profile', desc: 'The profile author that create the article'}
       expose :profile, :using => Profile, :documentation => {type: 'Profile', desc: 'The profile associated with the article'}



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ecddf6ea0ab59b2e80b9ebff2a7da6df15d18b71...f583c41fdfae49153c7f9437621d77e5e2610eab

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ecddf6ea0ab59b2e80b9ebff2a7da6df15d18b71...f583c41fdfae49153c7f9437621d77e5e2610eab
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170619/b9264852/attachment-0001.html>


More information about the Noosfero-dev mailing list