Module: StandardModel::ClassMethods

Defined in:
lib/app/models/concerns/standard_model.rb

Overview

Mixin to add methods to the classes themselves Used by calling model.method_name

Instance Method Summary collapse

Instance Method Details

#make_options(options) ⇒ Object

Turn the array into a list of options



37
38
39
# File 'lib/app/models/concerns/standard_model.rb', line 37

def make_options(options)
  options.collect { |t| [t, t.humanize] }
end

#without_callback(*args, &_block) ⇒ Object

Used by calling 'model.without_callback(*.args, &block) do'



27
28
29
30
31
32
# File 'lib/app/models/concerns/standard_model.rb', line 27

def without_callback(*args, &_block)
  skip_callback(*args)
  result = yield
  set_callback(*args)
  result
end