neo4j.rb

Travis-CI “The command ”bundle exec rake“ exited with 1.” + mystery 404 error

时间秒杀一切 提交于 2019-12-24 15:01:21
问题 bundle exec rake runs all tests perfectly fine locally . However, Travis CI keeps blowing up with Problem accessing /authentication without giving much more info to go on. Here's one of the failed builds: https://travis-ci.org/Nase00/Horizon/builds/48094102 For the life of me, I cannot figure out what is causing an authentication error when Travis tries to run bundle exec rake . Here's the project repo: https://github.com/Nase00/Horizon 回答1: I'm not sure what version of Neo4j Travis uses (

undefined method `find_by' for nil:NilClass when using `model_class: false`

纵然是瞬间 提交于 2019-12-24 06:20:14
问题 undefined method 'find_by' for nil:NilClass Extracted source (around line #38): def update respond_to do |format| if @tag.update(tag_params) format.html { redirect_to @tag, notice: 'Tag was successfully updated.' } format.json { render :show, status: :ok, location: @tag } else format.html { render :edit } format.json { render json: @artefact.errors, status: :unprocessable_entity } end end end I am working on modifying the scaffold generators to automatically process :relations as has_many ,

Neo4j gem - Preferred method to deal with admin relationship

ⅰ亾dé卋堺 提交于 2019-12-14 02:16:24
问题 This is mostly a design/efficiency question but I wanted to see if there was a preferred way to handle this in neo4j as opposed to how I would do it in a sql db. Right now I have 2 models - user and event . I also have a relationship between user and event to represent that they will attend the event. I want to figure out the best way to represent the admin of the event. In other words, I want to be able to query the events that are admined by a user. One way to do it is to create a new

neo4j uuid is not created

怎甘沉沦 提交于 2019-12-13 07:30:02
问题 class Client include Neo4j::ActiveNode end > client = Client.new => #<Client uuid: nil, bot_client_id: nil, created_at: nil, email: nil, first_name: nil, last_name: nil, sms: nil, telegram_id: nil, updated_at: nil> My expectation is that the uuid would be populated. 回答1: The uuid is only populated once the node object has been saved. So you could either do: client = Client.create Or: client = Client.new client.save 来源: https://stackoverflow.com/questions/43535208/neo4j-uuid-is-not-created

Method “rel_length” in Neo4j.rb doesn't work.

筅森魡賤 提交于 2019-12-11 11:15:13
问题 I need to get "friends of friends" of User . So, friend(rel_length: 2) doesn't work (ignores method), returning friends. class User include Neo4j::ActiveNode ... has_many :out, :friend, rel_class: Friend ... end class Friend include Neo4j::ActiveRel from_class User to_class User type 'friend' property :activity, type: String property :relation, type: String property :token, type: String end 回答1: For anybody finding this later the reason was because he was using an older version of the gem

Don't want to display neo4j relations in a form

不想你离开。 提交于 2019-12-11 10:42:04
问题 I'm using neo4j in my current app and it is my first time with this database, then I have a lot of doubts. The most important now is the following. I'm customizing my input forms (as you may see in this question I asked) and here is one of my models: class Contact include Neo4j::ActiveNode property :first_name, type: String property :surname, type: String property :email, type: String property :phones, type: String has_one :in, :address, type: :HAS_ADDRESS has_one :in, :title, type: :HAS

How do I create a Neo4j relationship via the rails console?

こ雲淡風輕ζ 提交于 2019-12-11 10:12:16
问题 I'm currently working through this tutorial and I'm stuck when it comes to creating relationships in the rails console. I've read through the Neo4jrb project documentation and a blog post on jayway.com but still can't figure it out. I've created a rails site and I want to create team nodes, league nodes, and relationships between them in a Neo4j database using my rails scripts. I have two models: One for League class Team include Neo4j::ActiveNode property :name, type: String has_one :out,

Neo4j gem - Plucking multiple nodes/relationships

随声附和 提交于 2019-12-11 09:37:20
问题 This may not be possible as it is right now but I have a query like so events = Event.as(:e).where("(( e.date_start - {current_time} )/{one_day_p}) < 1 ").users(:u, :rel).where("rel.reminded = {reminded_p}" ).params(reminded_p: false, one_day_p: one_day, current_time: time).pluck(:e,:u, :rel) The goal is to obtain the events where the start_date is less than a day away. Hypothetically I've tried to pluck the event, the user and the relationship. I need to do a different action with each. I

Neo4j gem - Querying from an array object

青春壹個敷衍的年華 提交于 2019-12-11 08:10:56
问题 In my previous example I had this query current_user.friends.events(:event, :rel).where("rel.admin = {admin_p} AND event.detail = {detail_p}").params(admin_p: true, detail_p: true).pluck(:event) current_user.friends.events brings me up to events to continue my chain, but does this work for if I already have an object that contains an array of events? In my example, I am trying to use geocoder to pull in proximity. So I have my user and events which are geocoded. Geocoder can do something like

Neo4j inconsistent behaviour of model classes

こ雲淡風輕ζ 提交于 2019-12-11 07:36:53
问题 I have created 5 models in my project using ActiveNode model and using neo4j gem. There is a model named Disease, defined as: class Disease include Neo4j::ActiveNode property :disease, type: String, constraint: :unique property :created_at, type: DateTime property :updated_at, type: DateTime enum factor_effect: [:relief, :worsen] # Associations has_many :in, :factors, type: :AFFECTED_BY end and Factor: class Factor include Neo4j::ActiveNode property :factor, type: String, constraint: :unique