Commit 674ad7ce862ece2304904e102981858c8274a50a
1 parent
1b7dcab6
Exists in
staging
and in
42 other branches
Support plugin model as a asset class
Showing
1 changed file
with
2 additions
and
4 deletions
Show diff stats
plugins/solr/lib/solr_plugin/search_helper.rb
| @@ -34,10 +34,6 @@ module SolrPlugin::SearchHelper | @@ -34,10 +34,6 @@ module SolrPlugin::SearchHelper | ||
| 34 | ], | 34 | ], |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | -# def asset_class(asset) | ||
| 38 | -# asset.to_s.singularize.camelize.constantize | ||
| 39 | -# end | ||
| 40 | - | ||
| 41 | def class_asset(klass) | 37 | def class_asset(klass) |
| 42 | klass.name.underscore.pluralize.to_sym | 38 | klass.name.underscore.pluralize.to_sym |
| 43 | end | 39 | end |
| @@ -111,6 +107,8 @@ module SolrPlugin::SearchHelper | @@ -111,6 +107,8 @@ module SolrPlugin::SearchHelper | ||
| 111 | 107 | ||
| 112 | def asset_class(asset) | 108 | def asset_class(asset) |
| 113 | asset.to_s.singularize.camelize.constantize | 109 | asset.to_s.singularize.camelize.constantize |
| 110 | + rescue | ||
| 111 | + asset.to_s.singularize.camelize.gsub('Plugin', 'Plugin::').constantize | ||
| 114 | end | 112 | end |
| 115 | 113 | ||
| 116 | def set_facets_variables | 114 | def set_facets_variables |