> On Mar 10, 2016, at 3:11 AM, Colin Law wrote:
>
> On 9 March 2016 at 22:25, David Williams wrote:
>> Colin Law wrote in post #1182073:
>>> On 9 March 2016 at 21:51, David Williams wrote:
"articles"."category_id" = ? ORDER BY "articles"."created_at" DESC
[["category_id", 1]]
On 9 March 2016 at 21:51, David Williams wrote:
> In my articles model, I created a scope that links categories to their
> respective articles posts. When I use the rails console, the method
> works perfectly when I query the db.
>
> article.rb
>
> scope :category_technology, -> {where(category_id
In my articles model, I created a scope that links categories to their
respective articles posts. When I use the rails console, the method
works perfectly when I query the db.
article.rb
scope :category_technology, -> {where(category_id: 1)}
@articles.category_technology
Article Load (0.5ms) SE
3 matches
Mail list logo