Module: Devise::Orm::SimplyStored::Hook

Defined in:
lib/devise/orm/simply_stored.rb

Instance Method Summary collapse

Instance Method Details

#devise_modules_hook!Object



11
12
13
14
15
# File 'lib/devise/orm/simply_stored.rb', line 11

def devise_modules_hook!
  yield
  return unless Devise.apply_schema
  devise_modules.each { |m| send(m) if respond_to?(m, true) }
end

#find_first(conditions) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/devise/orm/simply_stored.rb', line 19

def find_first(conditions)
  if conditions.any?
    send(:"find_by_#{conditions.keys.join('_and_')}", *conditions.values)
  else
    first
  end
end

#get(ary) ⇒ Object



26
27
28
# File 'lib/devise/orm/simply_stored.rb', line 26

def get(ary)
  find Array.wrap(ary).first
end

#to_adapterObject



16
17
18
# File 'lib/devise/orm/simply_stored.rb', line 16

def to_adapter
  self
end