end
alias :find_author_id_filter_values :find_assigned_to_id_filter_values
- IssueRelation::TYPES.keys.each do |relation_type|
+ IssueRelation::TYPES.each_key do |relation_type|
alias_method "sql_for_#{relation_type}_field".to_sym, :sql_for_relations
end
self.filters = {}
add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v])
else
- available_filters.keys.each do |field|
+ available_filters.each_key do |field|
add_short_filter(field, params[field]) if params[field]
end
end
def map_total(total, &block)
if total.is_a?(Hash)
- total.keys.each {|k| total[k] = yield total[k]}
+ total.each_key {|k| total[k] = yield total[k]}
else
total = yield total
end
# preferences.remove_block('news')
def remove_block(block)
block = block.to_s.underscore
- my_page_layout.keys.each do |group|
+ my_page_layout.each_key do |group|
my_page_layout[group].delete(block)
end
my_page_layout
@code
end
- ERROR_MESSAGES.keys.each { |state| define_method("#{state}?") { @code == state } }
+ ERROR_MESSAGES.each_key { |state| define_method("#{state}?") { @code == state } }
def successful?
@code == :successful
end
end
# Transforms dates into pixels witdh
- coords.keys.each do |key|
+ coords.each_key do |key|
coords[key] = (coords[key] * zoom).floor
end
coords