1module FlashRender
 
2  extend ActiveSupport::Concern
 
3
 
4  include FlashI18n
 
5
  • DuplicateMethodCall - calls 'flash.now' 2 times » reek
  • DuplicateMethodCall - calls 'translate_flash(value)' 2 times » reek
  • TooManyStatements - has approx 7 statements » reek
  • Complexity 6 » saikuro
6  def render(options = {}, locals = {}, &block)
 
7    flash_options = Hash === options ? options : locals
 
8
 
 9    self.class._flash_types.each do |flash_type|
  • Found = in conditional. It should probably be an == » roodi
10      if value = flash_options.delete(flash_type)
 
11        flash.now[flash_type] = translate_flash(value)
 
12      end
 
13    end
 
  • Found = in conditional. It should probably be an == » roodi
15    if other_flashes = flash_options.delete(:flash)
 
16      other_flashes.each do |key, value|
 
17        flash.now[key] = translate_flash(value)
 
18      end
 
19    end
 
 
21    super(options, locals, &block)
 
22  end
 
23end