Skip to content

Commit

Permalink
Merge pull request #2210 from eduardoj/mime_deprecation_warnings
Browse files Browse the repository at this point in the history
[webui][ci] Get rid of mime deprecation warnings
  • Loading branch information
Ana06 committed Oct 7, 2016
2 parents 9c0f306 + 9c37ffd commit e792f02
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/api/app/controllers/webui/feeds_controller.rb
Expand Up @@ -6,11 +6,11 @@ class Webui::FeedsController < Webui::WebuiController

def news
@news = StatusMessage.alive.limit(5)
raise ActionController::RoutingError.new('expected application/rss') unless request.format == Mime::RSS
raise ActionController::RoutingError.new('expected application/rss') unless request.format == Mime[:rss]
end

def latest_updates
raise ActionController::RoutingError.new('expected application/rss') unless request.format == Mime::RSS
raise ActionController::RoutingError.new('expected application/rss') unless request.format == Mime[:rss]
@latest_updates = get_latest_updated(10)
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/config/initializers/fast_json.rb
Expand Up @@ -4,6 +4,6 @@

ActionController::Renderers.add :json do |json, _|
json = Yajl::Encoder.encode(json) unless json.kind_of?(String)
self.content_type ||= Mime::JSON
self.content_type ||= Mime[:json]
json
end
2 changes: 1 addition & 1 deletion src/api/config/initializers/nokogiri_builder.rb
Expand Up @@ -5,7 +5,7 @@ module ActionView
module Template::Handlers
class NokogiriBuilder
class_attribute :default_format
self.default_format = Mime::XML
self.default_format = Mime[:xml]

def call(template)
"xml = ::Nokogiri::XML::Builder.new { |xml|" +
Expand Down
4 changes: 2 additions & 2 deletions src/api/config/initializers/wrap_parameters.rb
Expand Up @@ -46,7 +46,7 @@ def parse_parameters(env)
end

case request.content_mime_type
when Mime::JSON
when Mime[:json]
begin
data = Yajl::Parser.parse(request.raw_post)
rescue Yajl::ParseError => e
Expand All @@ -56,7 +56,7 @@ def parse_parameters(env)
request.body.rewind if request.body.respond_to?(:rewind)
data = {:_json => data} unless data.is_a?(Hash)
data.with_indifferent_access
when Mime::XML
when Mime[:xml]
data = Xmlhash.parse(request.body.read)
request.body.rewind if request.body.respond_to?(:rewind)
if data
Expand Down

0 comments on commit e792f02

Please sign in to comment.