Skip to content
This repository was archived by the owner on Jul 11, 2020. It is now read-only.
This repository was archived by the owner on Jul 11, 2020. It is now read-only.

Refinements on remote methods #4

Description

@dmcinnes

Should we allow refinements on remote methods like we do with associations.

Given a Post

class Post < ActiveRecord::Base
  has_many :comments
  def top_comments
     comments.order_by(:like_count)
  end
end

And its Comment:

class Comment < ActiveRecord::Base
   scope :edited, -> { where.not(updated_at: nil) }
end

Could we?

Post.first.top_comments.edited 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions