module LazyRecord::Scopes

Add ActiveRecord-style scope macros to your classes. Allows chaining.

Constants

SCOPE_MODULE_NAME

Public Instance Methods

lr_scope(method_name, lambda) click to toggle source
# File lib/lazy_record/scopes.rb, line 8
def lr_scope(method_name, lambda)
  extend mod = get_or_set_mod(SCOPE_MODULE_NAME)

  mod.module_eval do
    define_method(method_name, &lambda)
  end
end