Class: Pilgrim::Country

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/pilgrim/country.rb

Class Method Summary collapse

Class Method Details

.get_countries(mode = "all", arr_countries = []) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/models/pilgrim/country.rb', line 6

def self.get_countries(mode = "all", arr_countries = [])
	if mode == "include"
		where("name IN (?)", arr_countries).order("id ASC")
	elsif mode == "exclude"
		where("name NOT IN (?)", arr_countries).order("id ASC")
	else
		order("id ASC")
	end 
end