Sha256: 2fa53a83d57d5c0e9881997cbfd471138bf20c2ac3e5fb22282b30dc9e0ea6f1
Contents?: true
Size: 483 Bytes
Versions: 69
Compression:
Stored size: 483 Bytes
Contents
module ActiveRecord class DynamicScopeMatch def self.match(method) ds_match = self.new(method) ds_match.scope ? ds_match : nil end def initialize(method) @scope = true case method.to_s when /^scoped_by_([_a-zA-Z]\w*)$/ names = $1 else @scope = nil end @attribute_names = names && names.split('_and_') end attr_reader :scope, :attribute_names def scope? !@scope.nil? end end end
Version data entries
69 entries across 68 versions & 12 rubygems