[#2279] Moved select_values_for_field to a helper.

This commit is contained in:
Eric Davis committed 2009-04-22 12:02:07 -07:00
1 parent cb8d2bc6df
commit 92792f300b
2 files changed
+22 -21

No files matched your search

@@ -2,6 +2,8 @@ class OverheadTimeEntryActivityController < ApplicationController
unloadable
before_filter :require_admin
helper :overhead
include OverheadHelper
def index
if params[:custom_field]
@@ -14,25 +16,4 @@ class OverheadTimeEntryActivityController < ApplicationController
render :partial => 'values'
end
private
def select_values_for_field(field)
return [] if field.nil?
if field.field_format == 'list'
returning [] do |r|
field.possible_values.each do |item|
if item == 'Nil'
r << [l(:label_none), item] # Nil should use the none label
else
r << [item, item]
end
end
r
end
elsif field.field_format == 'bool'
return [[true,true],[false,false]]
end
end
end