Using scopes in conjunction with Serel::Question
wjgilmore opened this issue · comments
Hi,
I'm obviously not grasping something very fundamental, have done various searches and reviewed the spec tests in the hopes of finding an example, nothing turned up so am wondering whether I'm simply misunderstanding or whether per open issue #9 (titled "Outdated") this gem should no longer be used?
Specifically, how do you apply the scoping methods such as fromdate
and todate
? I've tried all combinations, including the simple:
from = DateTime.now.beginning_of_month
questions = Serel::Question.fromdate('2013-02-01').tagged('rails').get
When attempting to execute this I receive:
NoMethodError: undefined method `get' for 1359694800:Fixnum
Of course, the get
method does exist, because I can successfully run:
questions = Serel::Question.featured.get
Thanks for any assistance on this, Serel looks the most promising of the Ruby-based solutions I've found so far.
had this same issue - the lack of valid examples really makes it difficult to use this gem.
Fixed in 1.1.0! DateTime methods were returning the integer passed rather than the relation object. Thanks.
Fantastic, thanks!