<img src=“https://badge.fury.io/rb/friendly_id-method_scopes.svg” alt=“Gem Version” /> <img src=“https://travis-ci.org/gemvein/friendly_id-method_scopes.svg?branch=master” alt=“Build Status” /> <img src=“https://coveralls.io/repos/gemvein/friendly_id-method_scopes/badge.svg?branch=master” alt=“Coverage Status” />
FriendlyId Extension to allow method scopes, in addition to column and relationship scopes
In your Gemfile:
gem 'friendly_id' gem 'friendly_id-method_scopes'
In your model:
extend FriendlyId friendly_id :name, use: [:slugged, :method_scopes], scope_methods: :custom_method_name def custom_method_name # Code returning an array of eligible ids here end
This project rocks and uses MIT-LICENSE.