Open deepsidhu85 opened 2 weeks ago
After a conversation with Deep today, we've decided to drop searching by access level for now.
For my future reference, we explored the following solutions:
CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
CREATE TABLE person (
name text,
current_mood mood
);
INSERT INTO person VALUES ('Moe', 'happy');
SELECT * FROM person where current_mood::text ILIKE 'ha%';
ransacker :access_level, formatter: proc { |v| Member::AccessLevel.access_level_options_owner[v] } do |parent|
parent.table[:access_level]
end
def self.ransackable_scopes(auth = nil)
%i[access_level_or_email_like]
end
def self.access_level_or_email_like(term) query = Arel.sql(format("'$.* ? (@ LIKE_REGEX \"(?i).%s.*\")'", term))
where(User.arel_table[:email].matches("%#{term}%")) end
Summary
Currently, the members table for both groups and projects does not have sorting or searching capability. We want to update the table to add this functionality to allow the user to sort and search
Acceptance Criteria
and access level)Access Granted
andActions
Note: Take a look at the files within
app/components/samples
for an example of how this should work.