Module: Magic::EmptyText

Included in:
ExtCombo
Defined in:
lib/extmodules/magic.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/extmodules/magic.rb', line 92

def self.included(base)
  base.class_eval do

    alias_method :mod_empty_text, :prepare_config

    define_method :prepare_config do
      mod_empty_text rescue "skip"
      text = @config[:fieldLabel] || @default_config[:fieldLabel]
      @default_config.merge! :emptyText => "Select #{text}" unless text.nil?
    end

  end
end