Module: SimpleColumn
- Defined in:
- lib/simple_column/scopes.rb,
lib/simple_column/scopes/version.rb
Overview
Purpose:
Create dynamic modules which define dynamic methods for scopes based on a dynamic array of column names
Library Usage:
class Monkey < ActiveRecord::Base
include SimpleColumn::Scopes.new(:for_user_id, :for_seller_id, … etc)
# => for_user_id, and for_seller_id scopes are added to the model,
and they query on the user_id and seller_id columns, respectively
Defined Under Namespace
Classes: Scopes
Constant Summary collapse
- SCOPE_PREFIX =
"for_".freeze
- SCOPE_PREFIX_REGEX =
Regexp.new("\\A#{SimpleColumn::SCOPE_PREFIX}")