Sha256: e78e6285e152db47b4b92d4fa8ca5332fd1eb71bd11331f3011147c3493d6237

Contents?: true

Size: 453 Bytes

Versions: 12

Compression:

Stored size: 453 Bytes

Contents

class G5Updatable::SyncsController < G5Updatable::BaseUpdatableController

  before_filter :set_client

  def index
    timestamp = @client.locations.max_updated_at
    render json: {updated_at: formatted_timestamp(timestamp)}
  end

  private

  def set_client
    @client = G5Updatable::Client.find_by_urn!(params[:urn])
  end  

  def formatted_timestamp(timestamp)
    timestamp.in_time_zone.strftime("%I:%M%P on %B %e, %Y") if timestamp
  end  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
g5_updatable-0.10.3 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.10.2 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.10.1 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.10.0 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.9.0 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.8.0 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.7.2 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.7.1 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.7.0 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.6.1 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.6.0 app/controllers/g5_updatable/syncs_controller.rb
g5_updatable-0.5.1 app/controllers/g5_updatable/syncs_controller.rb