Revision 1682
Added by Jean-Philippe Lang almost 17 years ago
trunk/vendor/plugins/acts_as_searchable/lib/acts_as_searchable.rb | ||
---|---|---|
41 | 41 |
searchable_options[:columns] = [] << searchable_options[:columns] |
42 | 42 |
end |
43 | 43 |
|
44 |
if searchable_options[:project_key] |
|
45 |
elsif column_names.include?('project_id') |
|
46 |
searchable_options[:project_key] = "#{table_name}.project_id" |
|
47 |
else |
|
48 |
raise 'No project key defined.' |
|
49 |
end |
|
50 |
|
|
51 |
if searchable_options[:date_column] |
|
52 |
elsif column_names.include?('created_on') |
|
53 |
searchable_options[:date_column] = "#{table_name}.created_on" |
|
54 |
else |
|
55 |
raise 'No date column defined defined.' |
|
56 |
end |
|
57 |
|
|
44 |
searchable_options[:project_key] ||= "#{table_name}.project_id" |
|
45 |
searchable_options[:date_column] ||= "#{table_name}.created_on" |
|
58 | 46 |
searchable_options[:order_column] ||= searchable_options[:date_column] |
59 | 47 |
|
60 | 48 |
# Permission needed to search this model |
Also available in: Unified diff
Fixed: searchable model can't be loaded if table is not yet created (#1421).