lib/ab_admin/menu/builder.rb in ab_admin-0.6.1 vs lib/ab_admin/menu/builder.rb in ab_admin-0.7.0
- old
+ new
@@ -2,11 +2,12 @@
module Menu
class Builder < AbstractBuilder
include ::Singleton
def self.draw(&block)
- I18n.locale = AbAdmin.locale if AbAdmin.locale
- instance.instance_eval &block if block_given?
+ I18n.with_locale AbAdmin.locale do
+ instance.instance_eval &block if block_given?
+ end
end
def self.render(*args)
instance.render(*args)
end