# module to find slug or id in model module FriendlyFinder extend ActiveSupport::Concern included do scope :finder, ->(s) { where('id = ? OR slug = ?', s, s) } end end