Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
adding more ransack methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nehamand committed Dec 27, 2023
1 parent 981def6 commit 38ee939
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/allocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def self.ransackable_attributes(_auth_object = nil)
updated_at user_id]
end

def self.ransackable_associations(_auth_object = nil)
%w[project user]
end

private

def end_before_start?
Expand Down
4 changes: 4 additions & 0 deletions app/models/education_experience.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ class EducationExperience < ApplicationRecord
def self.ransackable_associations(_auth_object = nil)
["user"]
end

def self.ransackable_attributes(_auth_object = nil)
%w[course created_at end_date id institution start_date updated_at user_id]
end
end
5 changes: 5 additions & 0 deletions app/models/evaluation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def self.ransackable_associations(_auth_object = nil)
%w[answers evaluated evaluator questionnaire]
end

def self.ransackable_attributes(_auth_object = nil)
%w[created_at english_level evaluated_id evaluation_date evaluator_id id observation
questionnaire_id score updated_at]
end

private

def update_office_score
Expand Down
4 changes: 4 additions & 0 deletions app/models/office.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ def calculate_score
def self.ransackable_associations(_auth_object = nil)
%w[head users users_without_head]
end

def self.ransackable_attributes(_auth_object = nil)
%w[active city created_at head_id id score updated_at users_count]
end
end
4 changes: 4 additions & 0 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ def to_s
def self.ransackable_attributes(_auth_object = nil)
%w[active created_at id market name updated_at]
end

def self.ransackable_associations(_auth_object = nil)
%w[allocations punches]
end
end
4 changes: 4 additions & 0 deletions app/models/questionnaire.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ def to_s
def self.ransackable_attributes(_auth_object = nil)
%w[active created_at description id kind title updated_at]
end

def self.ransackable_associations(_auth_object = nil)
%w[evaluations questions]
end
end
4 changes: 4 additions & 0 deletions app/models/regional_holiday.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def self.ransackable_attributes(_auth_object = nil)
%w[created_at day id month name updated_at]
end

def self.ransackable_associations(_auth_object = nil)
["cities"]
end

private

def valid_date?
Expand Down
4 changes: 4 additions & 0 deletions app/models/talk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def self.ransackable_associations(_auth_object = nil)
["user"]
end

def self.ransackable_attributes(_auth_object = nil)
%w[created_at date event_name id talk_title updated_at user_id]
end

private

def future_date?
Expand Down
5 changes: 5 additions & 0 deletions app/models/vacation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def self.ransackable_associations(_auth_object = nil)
%w[commercial_approver denier hr_approver user]
end

def self.ransackable_attributes(_auth_object = nil)
%w[commercial_approver_id created_at denier_id end_date hr_approver_id id start_date status
updated_at user_id]
end

private

def approved_within_cancel_range?
Expand Down

0 comments on commit 38ee939

Please sign in to comment.