summaryrefslogtreecommitdiff
path: root/db/migrate/20120515104749_add_hunt_group_function_key.rb
blob: 02689d5f236f3ec5a5df7802a433a5a9cd7910a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class AddHuntGroupFunctionKey < ActiveRecord::Migration
  def up
    softkey_function = SoftkeyFunction.find_or_create_by_name('hunt_group_membership')
    gui_function = GuiFunction.find_or_create_by_name("softkey_function_#{softkey_function.name.downcase}_field_in_softkey_form",
                                                      :category => 'Softkey edit view', 
                                                      :description => "Show the softkey function '#{softkey_function.name}' in the softkey form.")
  end

  def down
    softkey_function = SoftkeyFunction.find_by_name('hunt_group_membership')
    softkey_function.destroy
    GuiFunction.find_by_name("softkey_function_#{softkey_function.name.downcase}_field_in_softkey_form").destroy
  end
end