Module: ActiveRecordLazyFindBy::Methods::ClassMethods

Defined in:
lib/active_record_lazy_find_by.rb

Instance Method Summary collapse

Instance Method Details

#lazy_find(id) ⇒ Object



50
51
52
# File 'lib/active_record_lazy_find_by.rb', line 50

def lazy_find(id)
  lazy_find_by(id: id)
end

#lazy_find_by(attributes = {}) ⇒ Object



45
46
47
48
# File 'lib/active_record_lazy_find_by.rb', line 45

def lazy_find_by(attributes = {})
  mod = ActiveRecordLazyFindBy.module_for(self, attributes)
  new(attributes).extend(mod)
end