thomas-mcdonald / serel

A Stack Exchange Relational Algebra. Or something along those lines.

Home Page:http://serel.tom.is

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

also see: http://stackoverflow.com/questions/15027718/using-date-related-scopes-with-serel-gem-stack-overflow-api

Fixed in 1.1.0! DateTime methods were returning the integer passed rather than the relation object. Thanks.

Fantastic, thanks!