I have a model called Author. An author has many Articles.
Articles have a scope called .published that does: where(published: true).
I want to load the author, with the published articles.
I tried:
Author.includes(:articles.published).find(params[:…
I want to DRY up several models by moving shared scopes into a module, something like:
module CommonScopes
extend ActiveSupport::Concern
module ClassMethods
scope :ordered_for_display, order("#{self.to_s.tableize}.rank asc")
end
end
I also want to …