summaryrefslogtreecommitdiff
path: root/db/migrate/20120515124103_add_hold_softkey_function.rb
blob: 4e16587303d543c7af5f859c0601d40405ad7b98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class AddHoldSoftkeyFunction < ActiveRecord::Migration
  def up
    softkey_function = SoftkeyFunction.find_or_create_by_name('hold')
    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('hold')
    softkey_function.destroy
    GuiFunction.find_by_name("softkey_function_#{softkey_function.name.downcase}_field_in_softkey_form").destroy
  end
end