[Git][noosfero/noosfero][stable-1.8] Merge branch 'pg-search-fixes' into 'master'
Rodrigo Souto
gitlab at mg.gitlab.com
Thu Jul 6 17:01:12 BRT 2017
Rodrigo Souto pushed to branch stable-1.8 at Noosfero / noosfero
Commits:
5865e899 by Rodrigo Souto at 2017-07-06T20:00:55+00:00
Merge branch 'pg-search-fixes' into 'master'
Pg search fixes
See merge request !1249
- - - - -
1 changed file:
- plugins/pg_search/lib/pg_search_plugin.rb
Changes:
=====================================
plugins/pg_search/lib/pg_search_plugin.rb
=====================================
--- a/plugins/pg_search/lib/pg_search_plugin.rb
+++ b/plugins/pg_search/lib/pg_search_plugin.rb
@@ -40,9 +40,7 @@ class PgSearchPlugin < Noosfero::Plugin
scope = query_scope.where(:id => scope.map(&:id)).reorder("")
end
- facets_params = facets.present? ? facets_options(asset, scope, facets) : {}
-
- {:results => scope.paginate(paginate_options), :facets => facets_params, :periods => periods}
+ {:results => scope.paginate(paginate_options), :facets => facets_options(asset, scope, facets), :periods => periods}
end
private
@@ -208,7 +206,7 @@ class PgSearchPlugin < Noosfero::Plugin
occurrence.value = argument
when 'relation'
klass_name = facet_slug.classify
- occurrence.target = klass_name.constantize.find(argument)
+ occurrence.target = klass_name.constantize.where(id: argument).first
else
return
end
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/5865e8992f60b9ecf764053e79d8f7ac89d2cd3b
---
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/5865e8992f60b9ecf764053e79d8f7ac89d2cd3b
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170706/808a339b/attachment-0001.html>
More information about the Noosfero-dev
mailing list