Module: Devise::Orm::Neo4j::Hook

Included in:
Neo4j::Rails::Model
Defined in:
lib/devise/orm/neo4j/hook.rb

Instance Method Summary collapse

Instance Method Details

#devise(*modules) ⇒ Object

Overwrite the devise method to control indexation dependent on the specified modules



15
16
17
18
19
# File 'lib/devise/orm/neo4j/hook.rb', line 15

def devise(*modules)
  # hack to get around Neo4j's requirement to index before uniqueness validation
  index :email, :type => :exact if modules.include?(:validatable)
  super
end

#devise_modules_hook!Object



5
6
7
8
9
10
11
12
# File 'lib/devise/orm/neo4j/hook.rb', line 5

def devise_modules_hook!
  extend Schema
  yield
  devise_modules.each { |m| send(m) if respond_to?(m, true) }
  
  # ensure we have the created_at property
  property :created_at, :type => Time
end