neo4jrb / devise-activegraph Goto Github PK
View Code? Open in Web Editor NEWDevise ORM for Neo4j
License: MIT License
Devise ORM for Neo4j
License: MIT License
New example Rails 5.1.4 project, gems:
# Secure ALL the things!
gem 'devise'
gem 'neo4j', '~> 8.2.1'
gem 'devise-neo4j'
rails g neo4j:devise User
generates:
20170910050708_create_user
20170910050708_devise_create_user_constraints_and_indexes
Running rails neo4j:migrate
results in:
== 20170910050708 CreateUser: running... =======================================
CYPHER CREATE CONSTRAINT ON (n:`User`) ASSERT n.`uuid` IS UNIQUE
== 20170910050708 CreateUser: migrated (0.0831s) ===============================
== 20170910050708 DeviseCreateUserConstraintsAndIndexes: running... ============
rails aborted!
Neo4j::Core::CypherSession::SchemaErrors::ConstraintValidationFailedError: Cypher error:
Neo.ClientError.Schema.ConstraintValidationFailed: Node(0) already exists with label `Neo4j::Migrations::SchemaMigration` and
property `migration_id` = '20170910050708'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/rails:9:in `require'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/rails:9:in `<top (required)>'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Then I renamed to:
20170910050708_create_user
20170910050709_devise_create_user_constraints_and_indexes
Running rails neo4j:migrate
results in:
== 20170910050708 CreateUser: running... =======================================
CYPHER CREATE CONSTRAINT ON (n:`User`) ASSERT n.`uuid` IS UNIQUE
== 20170910050708 CreateUser: migrated (0.0661s) ===============================
== 20170910050709 DeviseCreateUserConstraintsAndIndexes: running... ============
rails aborted!
NotImplementedError: NotImplementedError
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/rails:9:in `require'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/rails:9:in `<top (required)>'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Not sure what's happening there...
class User < Neo4j::Rails::Model
devise ......
property :name, :null => false, :length => 3
When a model is saved, the validity of field isn't checked .
When trying to register a user, my app freezes at ETHON: Libcurl initialized
in the console.
Here is the console output. I have a few custom fields in our form, and i've omitted the values:
Started POST "/webusers" for 127.0.0.1 at 2017-07-26 12:28:39 -0500
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"โ", "authenticity_token"=>"[TOKEN]", "webuser"=>{"first_name"=>"[FIRSTNAME]", "last_name"=>"[LASTNAME]", "email"=>"[EMAIL]", "organization"=>"[ORGANIZATION]", "job_title"=>"[JOB_TITLE]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
ETHON: Libcurl initialized
Here is my routes file where applicable to devise. My model is named Webuser
devise_for :webusers, controllers: {
registrations: "webusers/registrations"
}
Registration Controller to allow for the custom fields:
class Webusers::RegistrationsController < Devise::RegistrationsController
before_filter :configure_permitted_parameters
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :organization, :job_title])
end
end
My Webuser
model:
class Webuser
include Neo4j::ActiveNode
property :username, type: String
property :first_name, type: String
property :last_name, type: String
property :organization, type: String
property :job_title, type: String
property :admin, type: Boolean, default: false
property :suspended, type: Boolean, default: false
property :newsletters
serialize :newsletters
property :created_at, type: DateTime
property :updated_at, type: DateTime
# SSO
property :facebook_token, type: String
property :provider, type: String
property :uid, type: String
devise :omniauthable, :omniauth_providers => [:facebook,:twitter]
## Database authenticatable
property :email, type: String, default: ""
property :encrypted_password
## Rememberable
property :remember_created_at, type: DateTime
property :remember_token
## Recoverable
property :reset_password_token
property :reset_password_sent_at, type: DateTime
## Trackable
property :sign_in_count, type: Integer, default: 0
validates :sign_in_count, presence: true
property :current_sign_in_at, type: DateTime
property :last_sign_in_at, type: DateTime
property :current_sign_in_ip, type: String
property :last_sign_in_ip, type: String
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end
Using gem versions:
rails (4.2.6)
railties (4.2.6)
neo4j (8.1.3)
neo4j-core (7.2.2)
neo4j-rake_tasks (0.7.12)
devise-neo4j (2.1.1)
Using Neo4j Community edition 3.2.2
When I try to register a user which already exists, I get the following error:
Email translation missing: en.neo4j.errors.models.user.attributes.email.taken
I am using
devise-neo4j (2.0.0)
bcrypt-ruby (> 3.0)> 3.0)
devise (
neo4j (>= 3.0.0.alpha.6)
orm_adapter (> 0.5.0)> 1.2.1)
railties (>= 3.1)
warden (
When updating a person in my Person model on a clean rails app, I'm getting the following error:
Could not find a valid mapping for #<Person created_at:...
The changes get saved, but the error comes up. Here's part of the trace:
devise (3.4.1) lib/devise/mapping.rb:43:in `find_scope!'
devise (3.4.1) lib/devise/controllers/helpers.rb:166:in `signed_in_root_path'
devise (3.4.1) app/controllers/devise/registrations_controller.rb:132:in `after_update_path_for'
devise (3.4.1) app/controllers/devise/registrations_controller.rb:62:in `update'
actionpack (4.2.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.2.1) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.1) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
Update: only getting this error when attempting to update via Devise::RegistrationsController#update
When trying to install I get the error:
> bundle
Fetching source index for http://rubygems.org/
You have requested:
neo4j ~> 1.3.0
The bundle currently has neo4j locked at 1.3.0.
Try running `bundle update neo4j`
# Gemfile
source 'http://rubygems.org'
gem "neo4j", "~> 1.3.0"
gem "devise-neo4j"
I am trying to install devise-neo4j with devise and the omniauth (used by devise omniauthable) but with no result because there is an incompatibility between the devise-neo4j's oauth2 dependency and the omniauth-facebook's oauth2 dependency. The devise-neo4j depends on oauth2(0.4.1) and the omniauth-facebook gem depends on omniauth(~> 0.5.0). Can you update your dependencies?
Hello,
Please forgive any ignorance, as this is my first go at using devise as a whole, let alone with our neo4j database.
Ok, i've found myself needing to customize the views for the devise routes, and also needing to set some custom data from the controllers into these views. In order to do that, I was lead to do this:
rails g devise:views
rails g devise:controllers webusers # users model `Webuser`, scoping accordingly
The reason i asked devise for the controllers was so that I could add custom before_action
hooks in these devise routes, to set some data for the views.
Now, these controllers extend Devise::XController
, example: class Webusers::RegistrationsController < Devise::RegistrationsController
and I'm getting validatable
errors when trying to visit my sign up page, and I can't figure out where i'm going wrong. Is it because this was a devise controller generation, and not a neo4j-devise controller generation (though that option doesn't appear available)?
Anyway, here's my error:
NoMethodError in Webusers::RegistrationsController#new
undefined method `validatable?' for nil:NilClass
Extracted source (around line #170):
# Sets minimum password length to show to user
def set_minimum_password_length
if devise_mapping.validatable? # <- ERROR HIGHLIGHTED HERE
@minimum_password_length = resource_class.password_length.min
end
end
Here's the top few lines from the stack:
devise (4.2.0) app/controllers/devise_controller.rb:170:in `set_minimum_password_length'
activesupport (4.2.6) lib/active_support/callbacks.rb:432:in `block in make_lambda'
activesupport (4.2.6) lib/active_support/callbacks.rb:145:in `block in halting_and_conditional'
activesupport (4.2.6) lib/active_support/callbacks.rb:504:in `block in call'
activesupport (4.2.6) lib/active_support/callbacks.rb:504:in `each'
activesupport (4.2.6) lib/active_support/callbacks.rb:504:in `call'
activesupport (4.2.6) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.6) lib/action_view/rendering.rb:30:in `process'
Here is my controller:
class Webusers::RegistrationsController < Devise::RegistrationsController
before_action :load_custom_data
private
def load_custom_data
# loading my @vars's here
end
end
Model (the default after running rails g neo4j:devise Webuser
):
class Webuser
include Neo4j::ActiveNode
property :username, type: String
property :facebook_token, type: String
index :facebook_token
property :created_at, type: DateTime
property :updated_at, type: DateTime
property :email, type: String, null: false, default: ""
index :email
property :encrypted_password
## Rememberable
property :remember_created_at, type: DateTime
property :remember_token
index :remember_token
## Recoverable
property :reset_password_token
index :reset_password_token
property :reset_password_sent_at, type: DateTime
## Trackable
property :sign_in_count, type: Integer, default: 0
property :current_sign_in_at, type: DateTime
property :last_sign_in_at, type: DateTime
property :current_sign_in_ip, type: String
property :last_sign_in_ip, type: String
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end
Layout (views/layouts/devise.html.erb). The @var
's I actually need to pass in from the controller live with partials/header
.
<!DOCTYPE html>
<html>
<head>
<title><%= yield :site_title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<%= csrf_meta_tags %>
<link rel="shortcut icon" href="<%= image_path 'favicon.ico' %>">
<%=stylesheet_link_tag "print", media: "print"%>
<%=stylesheet_link_tag "account", media: "screen"%>
<script>
window.api_url = '<%=api_url%>'
</script>
<%=javascript_include_tag "account-head" %>
</head>
<body ng-app="MainApp" ng-controller="BaseController">
<%=render "partials/header"%>
<main ng-controller="AccountsController">
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<%= yield %>
</main>
<%=render "partials/footer"%>
<%=javascript_include_tag "account-footer"%>
<%=javascript_include_tag "tracking"%>
</body>
</html>
View (default after running rails g devise:views
)
<h2>Sign up</h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="field">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Sign up" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
Devise setup (default from running rails g devise:install --orm=neo4j
):
Devise.setup do |config|
config.mailer_sender = '[email protected]'
require 'devise/orm/neo4j'
config.case_insensitive_keys = [:email]
config.strip_whitespace_keys = [:email]
config.skip_session_storage = [:http_auth]
config.stretches = Rails.env.test? ? 1 : 11
config.reconfirmable = true
config.expire_all_remember_me_on_sign_out = true
config.password_length = 6..128
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
config.reset_password_within = 6.hours
config.sign_out_via = :delete
end
Is there anything specific to my setup that appears wonky?
Any advice to what i'm looking to achieve is greatly appreciated.
UPDATE
Here's my routes.rb, and this issue occurs when browsing to /register
Rails.application.routes.draw do
devise_for :webusers, :controllers => {
confirmations: 'webusers/confirmations',
passwords: 'webusers/passwords',
registrations: 'webusers/registrations',
sessions: 'webusers/sessions',
unlocks: 'webusers/unlocks'
}
devise_scope :webusers do
get '/register', to: 'webusers/registrations#new', as: :register
get '/profile', to: 'webusers/registrations#edit', as: :profile
get '/login', to: 'webusers/sessions#new', as: :login
get '/logout', to: 'webusers/sessions#destroy', as: :logout
end
...
end
I updated device-neo4j to 2.0.2 along with the latest versions of neo4j and neo4j-core in order to migrate to neo4j 3.0.1.
After the update, I started getting confirmation emails for every sign in and sign out.
Note that I had to add property :remember_token
to get the program work and I can check on the rails console that my user is confirmed.
User.find('user_id).confirmed? # returns true
What do you think is causing this behavior?
Thanks in advance
devise (4.1.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.1)
responders
warden (~> 1.2.3)
devise-neo4j (2.0.2)
bcrypt (>= 3.0)
devise (>= 3.0)
neo4j (>= 3.0.0)
orm_adapter (~> 0.5.0)
railties (>= 3.1)
warden (>= 1.2.1)
neo4j (7.0.9)
activemodel (~> 4)
activesupport (~> 4)
neo4j-core (>= 6.0.0)
orm_adapter (~> 0.5.0)
neo4j-core (6.1.4)
activesupport
faraday (~> 0.9.0)
faraday_middleware (~> 0.10.0)
faraday_middleware-multi_json
httparty
httpclient
json
multi_json
neo4j-rake_tasks (>= 0.3.0)
net-http-persistent
Extracted source (around line #62):
60 list = response.body || []
61 list.map do |item|
62 {type: CONSTRAINT_TYPES[item[:type]],
63 label: item[:label].to_sym,
64 properties: item[:property_keys].map(&:to_sym)}
Fulltrace:
neo4j-core (7.0.0) lib/neo4j/core/cypher_session/adaptors/http.rb:62:in `constraints'
neo4j-core (7.0.0) lib/neo4j/core/cypher_session.rb:36:in `block (2 levels) in <class:CypherSession>'
neo4j (8.0.0) lib/neo4j/model_schema.rb:35:in `model_constraints'
neo4j (8.0.0) lib/neo4j/model_schema.rb:131:in `each_schema_element'
neo4j (8.0.0) lib/neo4j/model_schema.rb:94:in `validate_model_schema!'
neo4j (8.0.0) lib/neo4j/active_base.rb:78:in `validate_model_schema!'
neo4j (8.0.0) lib/neo4j/active_base.rb:50:in `new_query'
neo4j (8.0.0) lib/neo4j/active_node/query/query_proxy.rb:305:in `_query'
neo4j (8.0.0) lib/neo4j/active_node/query/query_proxy.rb:290:in `_query_model_as'
neo4j (8.0.0) lib/neo4j/active_node/query/query_proxy.rb:113:in `base_query'
neo4j (8.0.0) lib/neo4j/active_node/query/query_proxy.rb:98:in `query_as'
neo4j (8.0.0) lib/neo4j/active_node/query/query_proxy.rb:87:in `query'
neo4j (8.0.0) lib/neo4j/active_node/query/query_proxy_methods.rb:253:in `first_and_last'
neo4j (8.0.0) lib/neo4j/active_node/query/query_proxy_methods.rb:31:in `first'
neo4j (8.0.0) lib/neo4j/active_node/orm_adapter.rb:42:in `find_first'
devise (4.2.0) lib/devise/models/authenticatable.rb:267:in `find_first_by_auth_conditions'
devise (4.2.0) lib/devise/models/authenticatable.rb:263:in `find_for_authentication'
devise (4.2.0) lib/devise/models/database_authenticatable.rb:162:in `find_for_database_authentication'
devise (4.2.0) lib/devise/strategies/database_authenticatable.rb:8:in `authenticate!'
warden (1.2.6) lib/warden/strategies/base.rb:53:in `_run!'
warden (1.2.6) lib/warden/proxy.rb:358:in `block in _run_strategies_for'
warden (1.2.6) lib/warden/proxy.rb:353:in `each'
warden (1.2.6) lib/warden/proxy.rb:353:in `_run_strategies_for'
warden (1.2.6) lib/warden/proxy.rb:323:in `_perform_authentication'
warden (1.2.6) lib/warden/proxy.rb:127:in `authenticate!'
devise (4.2.0) app/controllers/devise/sessions_controller.rb:17:in `create'
actionpack (5.0.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.0.0.1) lib/abstract_controller/base.rb:188:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.0.0.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:126:in `call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:455:in `call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.0.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.0.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in `instrument'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.0.0.1) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
searchkick (1.4.1) lib/searchkick/logging.rb:153:in `process_action'
actionpack (5.0.0.1) lib/abstract_controller/base.rb:126:in `process'
actionview (5.0.0.1) lib/action_view/rendering.rb:30:in `process'
actionpack (5.0.0.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (5.0.0.1) lib/action_controller/metal.rb:262:in `dispatch'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.0.0.1) lib/action_dispatch/routing/mapper.rb:16:in `block in <class:Constraints>'
actionpack (5.0.0.1) lib/action_dispatch/routing/mapper.rb:46:in `serve'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:725:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:38:in `call'
rack (2.0.1) lib/rack/head.rb:12:in `call'
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
neo4j (8.0.0) lib/neo4j/migrations/check_pending.rb:16:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `block in tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `tagged'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
request_store (1.3.1) lib/request_store/middleware.rb:9:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.0.1) lib/rails/engine.rb:522:in `call'
puma (3.6.2) lib/puma/configuration.rb:225:in `call'
puma (3.6.2) lib/puma/server.rb:578:in `handle_request'
puma (3.6.2) lib/puma/server.rb:415:in `process_client'
puma (3.6.2) lib/puma/server.rb:275:in `block in run'
puma (3.6.2) lib/puma/thread_pool.rb:116:in `block in spawn_thread'
I removed the comment in config/initializers/devise.rb
as this guide show it but it is not working.
# Send a notification email when the user's password is changed
config.send_password_change_notification = true
== 20230314133654 CreateUser: running... =======================================
CYPHER CREATE CONSTRAINT FOR (n:`User`) REQUIRE n.`uuid` IS UNIQUE
== 20230314133654 CreateUser: migrated (0.1260s) ===============================
== 20230314133654 DeviseCreateUserConstraintsAndIndexes: running... ============
rake aborted!
Neo4j::Driver::Exceptions::ClientException: Node(1) already exists with label `ActiveGraph::Migrations::SchemaMigration` and property `migration_id` = '20230314133654'
/Users/nomasprime/Organisations/playtimestudios/contacts/server/vendor/bundle/ruby/3.2.0/gems/neo4j-ruby-driver-4.4.3/ruby/neo4j/driver/internal/util/result_holder.rb:38:in `result!'
/Users/nomasprime/Organisations/playtimestudios/contacts/server/vendor/bundle/ruby/3.2.0/gems/neo4j-ruby-driver-4.4.3/ruby/neo4j/driver/internal/internal_result.rb:15:in `has_next?'
/Users/nomasprime/Organisations/playtimestudios/contacts/server/vendor/bundle/ruby/3.2.0/gems/neo4j-ruby-driver-4.4.3/lib/neo4j/driver/synchronizable.rb:16:in `block (4 levels) in with_sync_wrapper'
/Users/nomasprime/Organisations/playtimestudios/contacts/server/vendor/bundle/ruby/3.2.0/gems/async-2.4.2/lib/kernel/sync.rb:20:in `Sync'
/Users/nomasprime/Organisations/playtimestudios/contacts/server/vendor/bundle/ruby/3.2.0/gems/neo4j-ruby-driver-4.4.3/lib/neo4j/driver/synchronizable.rb:16:in `block (3 levels) in with_sync_wrapper'
/Users/nomasprime/Organisations/playtimestudios/contacts/server/vendor/bundle/ruby/3.2.0/gems/neo4j-ruby-driver-4.4.3/ruby/neo4j/driver/internal/internal_result.rb:31:in `each'
/Users/nomasprime/Organisations/playtimestudios/contacts/server/vendor/bundle/ruby/3.2.0/gems/activegraph-11.3.1/lib/active_graph/core/result.rb:16:in `each'
Hi.
I'm looking to use neo4j as a database for a rails api and I'll need to use token authentication to support an SPA front-end. Does devise-neo4j
support token authentication? I know it's been removed from devise
for quite some time and I'm just wondering if devise-neo4j
has added it back in.
Thanks!
I have a devise model, Candidates. When I set the null option to false. I'm unable to run the server or any migrations.
property :email, type: String, null: false, default: ''
gems/neo4j-8.0.1/lib/neo4j/shared/property.rb:150:in
property': Invalid options for property
emailon
Candidate`: null (ArgumentError)
Hi will this be supporting the latest version of devise anytime soon?
Hi,
Following the instructions gave me the error "No session, please create a session first with Neo4j::Session.open(:server_db) or :embedded_db)" upon account creation. Had to add:
require 'neo4j/railtie' to /config/application.rb
you might want to include this in the instructions.
Running through the example code, I'm getting a strange condition where the "email" property is reverting to empty after a few logins.
I took a screencap of this happening, as its a little hard to explain:
https://www.youtube.com/watch?v=qI_ep7Ffx58
Any insights? I'd really like to use Devise and Neo4j in a service I'm working on
I'm playing around with the devise module :confirmable
, and noticed that the ## Confirmable
block that is commented out in the generated user model is missing the property :unconfirmed_email, type: String
, which is required I think when using the module.
I'm just curious if that was intentional or not.
Thanks!
In the Gemfile.lock it specifies version 4.2.3 for all rails gems. I'm using rails 5 and have no idea if i can fix this. Not sure if I can change it to accept rails 5. Has anyone else noticed this and is there an active fix? I don't want to change stuff and break a ton of things.
DEPRECATION WARNING: ActiveSupport::PerThreadRegistry is deprecated and will be removed in Rails 7.1.
Use `Module#thread_mattr_accessor` instead.
(called from <main> at /Users/user/Organisations/playtimestudios/contacts/server/config/application.rb:17)
WARNING: Zeitwerk defines the constant Devise after the directory
/Users/user/.asdf/installs/ruby/3.2.1/lib/ruby/gems/3.2.0/gems/devise-activegraph-3.0.0/lib/devise
To prevent that, please configure the loader to ignore it:
loader.ignore("#{__dir__}/devise")
Otherwise, there is a flag to silence this warning:
Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
Could not find generator 'neo4j:active_graph'. (Rails::Command::Base::CorrectableError)
Run `bin/rails generate --help` for more options.
I have never before submitted an issue on GitHub or anywhere else, so please let me know if I'm doing something wrong.
I am now working on integrating devise-neo4j with my app. After adding the recoverable property to my User model I ran into an issue. When submitting a new password, it returns the error that the year method is not supported by NilClass. It appears that devise tries to set the reset_password_at property to nil. Upon saving to the neo4j database this gives an error.
It seems to me that this is an issue for devise-neo4j, because it could be normal behaviour for both devise and neo4j, but I'm not sure.
Let me know what I can do to help fix this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.