Do not fail when JSON engine is not found
and fallback to default
This commit is contained in:
parent
6e5fc9c833
commit
8a49001b0f
@ -2,6 +2,7 @@
|
||||
|
||||
## 0.1.2 (unreleased)
|
||||
* Add RablRails#render method (see README or source code)
|
||||
* Fix fail when JSON engine is not found. Now fallback to MultiJson.default_adapter
|
||||
|
||||
## 0.1.1
|
||||
|
||||
|
@ -29,15 +29,13 @@ module RablRails
|
||||
|
||||
def self.configure
|
||||
yield self
|
||||
post_configure
|
||||
end
|
||||
|
||||
def self.cache_templates?
|
||||
ActionController::Base.perform_caching && @@cache_templates
|
||||
end
|
||||
|
||||
private
|
||||
def self.post_configure
|
||||
MultiJson.engine = self.json_engine
|
||||
|
||||
def self.set_conversion_engines!
|
||||
MultiJson.use(self.json_engine) rescue nil
|
||||
end
|
||||
end
|
||||
|
@ -3,6 +3,7 @@ module RablRails
|
||||
initializer "rabl.initialize" do |app|
|
||||
ActiveSupport.on_load(:action_view) do
|
||||
ActionView::Template.register_template_handler :rabl, RablRails::Handlers::Rabl
|
||||
RablRails.set_conversion_engines!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user