R
R
ruslannasrutdinov2016-02-04 08:35:25
Ruby on Rails
ruslannasrutdinov, 2016-02-04 08:35:25

Why is rel_length in neo4jrb not working?

There is a User class.
class User
include Neo4j::ActiveNode
...
has_many :out, :friend, rel_class: Friend
...
end
Users communicate through friend
class Friend
include Neo4j::ActiveRel
from_class User
to_class User
type 'friend'
end Retrieve
all friends of friends current user.
Next line: @user.friend(:f, :r, rel_length:2).pluck(:f) returns the friends of the current user. And you need friends of friends. Moreover, instead of rel_length:2, you can write any key:value pair. Even abracadabra. It seems to ignore this third parameter.
@user.friend.friend(:f).where("f.user_id <> '#{@user.user_id}'").pluck(:f)
So far I've only found this solution, but it seems to me that it's not quite optimal solution.
Who faced, prompt please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Taras Serevann, 2014-09-23
@Taras_Serevann

This will not work in any normal social network + browser security settings will make themselves felt. Although in the same VK you can do a tricky trick with click junking and repost on behalf of the user

A
Azim Kurt, 2014-10-31
@Symphony

– WAT?
I apologize for the picture, but that's the look on my face when people ask questions like this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question