Fixed: searchable model can't be loaded if table is not yet created (#1421).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1682 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
be2b8a62f4
commit
c39161a6fc
|
@ -41,20 +41,8 @@ module Redmine
|
|||
searchable_options[:columns] = [] << searchable_options[:columns]
|
||||
end
|
||||
|
||||
if searchable_options[:project_key]
|
||||
elsif column_names.include?('project_id')
|
||||
searchable_options[:project_key] = "#{table_name}.project_id"
|
||||
else
|
||||
raise 'No project key defined.'
|
||||
end
|
||||
|
||||
if searchable_options[:date_column]
|
||||
elsif column_names.include?('created_on')
|
||||
searchable_options[:date_column] = "#{table_name}.created_on"
|
||||
else
|
||||
raise 'No date column defined defined.'
|
||||
end
|
||||
|
||||
searchable_options[:project_key] ||= "#{table_name}.project_id"
|
||||
searchable_options[:date_column] ||= "#{table_name}.created_on"
|
||||
searchable_options[:order_column] ||= searchable_options[:date_column]
|
||||
|
||||
# Permission needed to search this model
|
||||
|
|
Loading…
Reference in New Issue