Sha256: a300a75d0683adf15f7acb05887b29edae5b43f9abd8beeb585ece6cd245a438

Contents?: true

Size: 594 Bytes

Versions: 2

Compression:

Stored size: 594 Bytes

Contents

require 'resty/child_path'

Rails.application.config.middleware.use Resty::ChildPath, '<%= application_name.underscore %>'

ActiveRecord::Base.include_root_in_json = false

# get the time/date format right ;-)
class DateTime
  def as_json(options = nil)
    strftime('%Y-%m-%dT%H:%M:%S.%s%z')
  end
end
class ActiveSupport::TimeWithZone
  def as_json(options = nil)
    strftime('%Y-%m-%dT%H:%M:%S.%s%z')
  end
end
class Date
  def as_json(options = nil)
    strftime('%Y-%m-%dT%H:%M:%S.%s%z')
  end
end

class Time
  def as_json(options = nil)
    strftime('%Y-%m-%dT%H:%M:%S.%s%z')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
resty-generators-0.3.0 lib/generators/resty/setup/templates/initializer.rb
resty-generators-0.2.0 lib/generators/resty/setup/templates/initializer.rb