class Client
=begin
Clients are individual users
=end
include Neo4j::ActiveNode
include Neo4j::UndeclaredProperties
include Neo4j::Timestamps # will give model created_at and updated_at timestamps
property :bot_client_id
property :sms
property :telegram_id
property :first_name
property :last_name
property :email
end
When I create a new node, there is no uuid populated:
client = Client.new
when I try to find a created client, I get a runtime error:
client = Client.find_by(bot_client_id: 'botid')
Details of the error:
RuntimeError: No session defined!
from /usr/local/rvm/gems/ruby-2.2.1/gems/neo4j-8.0.13/lib/neo4j/active_base.rb:9:in `block in current_session'
from /usr/local/rvm/gems/ruby-2.2.1/gems/neo4j-8.0.13/lib/neo4j/active_base.rb:8:in `tap'
from /usr/local/rvm/gems/ruby-2.2.1/gems/neo4j-8.0.13/lib/neo4j/active_base.rb:8:in `current_session'
from /usr/local/rvm/gems/ruby-2.2.1/gems/neo4j-8.0.13/lib/neo4j/model_schema.rb:35:in `model_constraints'
from /usr/local/rvm/gems/ruby-2.2.1/gems/neo4j-8.0.13/lib/neo4j/model_schema.rb:131:in `each_schema_element'
I have a def initialize
method which includes:
neo4j_adaptor = Neo4j::Core::CypherSession::Adaptors::HTTP.new('http://user:pass@host:7474')
Neo4j::ActiveBase.on_establish_session { Neo4j::Core::CypherSession.new(neo4j_adaptor) }