noosfero | 3 new commits pushed to repository

Daniela Feitosa danielafeitosa at colivre.coop.br
Tue Feb 10 10:46:03 BRST 2015


On 09-02-2015 22:28, Bráulio Bhavamitra wrote:
>
>
>       Bráulio Bhavamitra pushed to refs/heads/master at Noosfero /
>       noosfero <https://gitlab.com/noosfero/noosfero>
>
>
>         Commits:
>
>   * *fcf765cf
>     <https://gitlab.com/noosfero/noosfero/commit/fcf765cfd4de3aba2d77c17a5e5a0ebdc754908e>*
>
>     by Eduardo Passos /at 2015-02-09T23:48:49Z/
>     statistics-block: add products counter
>
(...)
> # *plugins/statistics/lib/statistics_block.rb *
> ------------------------------------------------------------------------
> --- a/plugins/statistics/lib/statistics_block.rb
> +++ b/plugins/statistics/lib/statistics_block.rb
(...)
>#
> +  def products
> +    if owner.kind_of?(Environment)
> +      owner.products.where("profiles.enabled = 't' and profiles.visible = 't'").count

Instead of comparing with string "t", the attributes should be compared 
with boolean true, like:

owner.products.where("profiles.enabled = true and profiles.visible = true").count



-- 
Daniela Soares Feitosa
Colivre - Cooperativa de Tecnologias Livres
http://www.Colivre.coop.br/
55 71 3331-2299/ 55 71 8165-1685

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150210/2e35bed7/attachment.html>


More information about the Noosfero-dev mailing list