I have a problem with the implementation of the search in the project
I have such models(bring a simplified version)
User
id
name
Friends
user_id
friend_id
Post
id
title
author_id
is_public
PostDeniedUser
post_id
user_id
some explanations:
User can create post. Post can be public or private. If post private
only
friends of author can see it post, but author can denied access to some
friends.
I need to implement search Post by title considering visibility for each
user.
some explanations:
User can search in all public posts, in private posts of his friends
which
are not denied in one query.
I think create some model SearchPost and like NewsFeed.
duplicate all the data on posts for each user, taking into account the
availability of, and then just make an inquiry with the search by title
by authorized
users
Thanks. And how better to create access posts for users. After all, i
need
to create a relationship with each user. Delayed_job gem will be good?
17 Дек 2014 г. 17:08 пользователь “Vivek S.” [email protected]
написал:
But if in application will be about1000 or 10000 or more user i need do
1000 or 10000 or more insert queries. To set access for one post( access
or
denied). Or i not right underatand you?
17 Дек 2014 г. 18:29 пользователь “Vivek S.” [email protected]
написал:
:access_type => “Public/Private”
:type = “Allowed / Denied”
if Public then no need to create access.
if Private create access only those who you want to show / hide
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.