Class: Refinery::RaceRegistrations::Person

Inherits:
Core::BaseModel
  • Object
show all
Includes:
Humanizer
Defined in:
app/models/refinery/race_registrations/person.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#bypass_humanizerObject

Returns the value of attribute bypass_humanizer.



11
12
13
# File 'app/models/refinery/race_registrations/person.rb', line 11

def bypass_humanizer
  @bypass_humanizer
end

#registration_idsObject

Returns the value of attribute registration_ids.



11
12
13
# File 'app/models/refinery/race_registrations/person.rb', line 11

def registration_ids
  @registration_ids
end

Class Method Details

.search(search, sort, person) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'app/models/refinery/race_registrations/person.rb', line 36

def self.search(search, sort, person)
  registration_ids = nil

  if person.present? && person[:registration_ids].present?
    registration_ids =  person[:registration_ids].select{|reg_id| reg_id.to_i > 0  }
  end

  if search
    if sort != ""
      search_by_sort_and_registration_ids(search,sort,registration_ids)
    else
      search_by_sort_and_registration_ids(search,"surname",registration_ids)
    end
  else
    search_by_registration_ids(registration_ids)
  end
end