2
I want to seek for example 10 random people of the same party I did as follows, but this selecting people from all parties, what can be done? = D
class Pessoa < ActiveRecord::Base
class << self
def filtra_pessoas()
Pessoa.where('rand()', partido: "sem partido").first(10)
end
end
end
It worked, thanks. when I use this method again it does not list, only replaces the search can you tell how I can solve it? = D example: filtra_people() // search "10" persons "without party" filtra_people() // search "8" person of "such party"
– Erasmo Santos
@Erasmosantos creates another question and explains how I help you :D
– Luiz Carvalho