Skip to content
Snippets Groups Projects
Commit a13d79c1 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

check if devise stored the new user and save at repository

parent 477aafe0
No related branches found
No related tags found
No related merge requests found
class RegistrationsController < Devise::RegistrationsController
after_action :create_user_dependencies, only: :create
private
def create_user_dependencies
# if the user repository is orient db, then create the node in graph
# otherwise, nothing happens
user_repository.save resource
if resource.persisted?
user_repository.save resource
end
end
def user_repository
......
......@@ -8,7 +8,7 @@ module OrientDb
end
def save(user)
connection.query sprintf("INSERT INTO User (title, u_id) VALUES (%s, %d)", user.email, user.id)
connection.command sprintf("INSERT INTO User (title, u_id) VALUES ('%s', %d)", user.email, user.id)
end
def update(params={})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment