Updated

app/controllers/concerns / flash_render.rb

A
23 lines of codes
1 methods
19.7 complexity/method
1 churn
19.65 complexity
0 duplications
module FlashRender
  1. FlashRender has no descriptive comment
extend ActiveSupport::Concern include FlashI18n def render(options = {}, locals = {}, &block)
  1. FlashRender#render has approx 7 statements
flash_options = Hash === options ? options : locals self.class._flash_types.each do |flash_type| if value = flash_options.delete(flash_type) flash.now[flash_type] = translate_flash(value)
  1. FlashRender#render calls 'flash.now' 2 times Locations: 0 1
  2. FlashRender#render calls 'translate_flash(value)' 2 times Locations: 0 1
end end if other_flashes = flash_options.delete(:flash) other_flashes.each do |key, value| flash.now[key] = translate_flash(value)
  1. FlashRender#render calls 'flash.now' 2 times Locations: 0 1
  2. FlashRender#render calls 'translate_flash(value)' 2 times Locations: 0 1
end end super(options, locals, &block) end end