Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix custom_field_path for been usable on new instances of chiliproject

  • Loading branch information...
commit af4d46176b1512487298f8f83b8e0eda5f8c5981 1 parent f7352fc
Francisco de Juan fjuan authored
6 lib/redmine_project_filtering/patches/custom_field_patch.rb
@@ -9,8 +9,10 @@ def self.included(base) # :nodoc:
9 9 base.class_eval do
10 10 unloadable
11 11 named_scope( :used_for_project_filtering, lambda do |*args|
12   - used_field_setting = Setting['plugin_redmine_project_filtering']['used_fields'] || {}
13   - used_fields = used_field_setting.keys.collect(&:to_i)
  12 + plugin_settings = Setting['plugin_redmine_project_filtering']
  13 + used_field_setting = Setting['plugin_redmine_project_filtering'].present? ? plugin_settings['used_fields'] : {}
  14 + used_field_hash = used_field_setting.class == Hash ? used_field_setting : {}
  15 + used_fields = used_field_hash.keys.collect(&:to_i)
14 16 { :conditions => [ "custom_fields.type = 'ProjectCustomField'
15 17 AND custom_fields.field_format = 'list'
16 18 AND custom_fields.id IN (?)", used_fields ] }

0 comments on commit af4d461

Please sign in to comment.
Something went wrong with that request. Please try again.