You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project in Ruby 2.2.4 with Rails 4.1.2 in which want to implement a new feature to allow users to connect with other users, so I will keep my database in Postgress (using ActiveRecords) with Neoid. I followed all the steps of https://github.com/neoid-gem/neoid documentation, but when I try to save a user has returned the following error:
I have created a new project to analyze if my setup of Neo4j was not the problem, by following this tutorial: https://www.sitepoint.com/using-a-graph-database-with-ruby-part-ii-integration/ and the error did not appear. I tried with another with another class in my project and apparently worked well, which leads me to believe that the problem is something specific in User class. Here the parts involved code:
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable, :omniauthable
include Entity
include Neoid::Node
extend FriendlyId
friendly_id :full_name, use: :slugged
extend Enumerize
extend ActiveModel::Naming
neoidable do |c|
c.field :slug
end
[...]
end
class Connection < ActiveRecord::Base
include Neoid::Relationship
belongs_to :user
belongs_to :connected, class_name: User
neoidable do |c|
c.relationship start_node: :user, end_node: :connected, type: :connection
end
end
class CreateConnections < ActiveRecord::Migration
def change
create_table :connections do |t|
t.integer :user_id
t.integer :connected_id
t.timestamps
end
end
end
The question is, has anyone ever had a problem like this? Or have some feature in the User class that may be causing this error (like Devise, Enumerize ...)?
Already tried:
Reset the Postgress database;
Use neo_save on the users, but the error does not allow this action. Like "Inserting records of existing app" on documentation;
Check if the user is valid When I try to save;
Disabling auto saving to Neo4j;
The text was updated successfully, but these errors were encountered:
I have a project in Ruby 2.2.4 with Rails 4.1.2 in which want to implement a new feature to allow users to connect with other users, so I will keep my database in Postgress (using ActiveRecords) with Neoid. I followed all the steps of https://github.com/neoid-gem/neoid documentation, but when I try to save a user has returned the following error:
NoMethodError (undefined method `neo_id 'for # <Hash: 0x0000000a4542a0>)
I have created a new project to analyze if my setup of Neo4j was not the problem, by following this tutorial: https://www.sitepoint.com/using-a-graph-database-with-ruby-part-ii-integration/ and the error did not appear. I tried with another with another class in my project and apparently worked well, which leads me to believe that the problem is something specific in User class. Here the parts involved code:
The question is, has anyone ever had a problem like this? Or have some feature in the User class that may be causing this error (like Devise, Enumerize ...)?
Already tried:
The text was updated successfully, but these errors were encountered: