Hello Mazharul!

First, what sort of error are you getting?  If you're getting some sort of 
exception, we'd welcome an issue here:

https://github.com/neo4jrb/neo4j/issues/new

Also, a somewhat simpler way to do the query is this:
 
@friends = @user.friends.rel_where(accepted: true)

You might also want to put a `.to_a` at the end to create an array, but you 
can use any `Enumerable` method instead (each/map/select/etc...)

Brian

On Monday, March 23, 2015 at 11:41:13 AM UTC+1, Mazharul Islam wrote:
>
> for example a user "A" sent a friend request to user "B" and this relation 
> is maintained by a ActiveRel Model named 'FriendWith',and in this class 
> there is a property called 'accepted' which is by default false. now if 
> user B accepts the request that will be become true.
>
> I was actually trying to something like this. but its not working. 
>
> class User
> has_many :friends, rel_class: FriendWith, model_class: User
> end
>
> class FriendWith
> property :accepted, Boolean, default: false
> end
>
> @friends = @user.friends(:u, :f).where('f.accepted = true')
>
> can anyone help me ? I want answer in ruby code.
>
> i am using this gem https://github.com/neo4jrb/neo4j
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to