Module: Accountability::ProductsHelper

Defined in:
app/helpers/accountability/products_helper.rb

Instance Method Summary collapse

Instance Method Details

#disable_category_field?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/helpers/accountability/products_helper.rb', line 17

def disable_category_field?
  @stage != 'initial'
end

#schedule_optionsObject



8
9
10
11
# File 'app/helpers/accountability/products_helper.rb', line 8

def schedule_options
  options = Accountability::Product.schedules
  options.keys.map { |schedule_name| [schedule_name.titleize, schedule_name] }
end

#scope_options(scope) ⇒ Object



13
14
15
# File 'app/helpers/accountability/products_helper.rb', line 13

def scope_options(scope)
  scope.options.map { |option| [option.to_s.titleize, option] }
end

#source_class_optionsObject



3
4
5
6
# File 'app/helpers/accountability/products_helper.rb', line 3

def source_class_options
  options = Accountability::Offerable.collection.stringify_keys
  options.keys.map { |offerable_name| [offerable_name.titleize, offerable_name] }
end