Newer
Older
# == Schema Information
#
# Table name: research_laboratories
#
# id :uuid not null, primary key
# address :string
# city :string
# country :string
# name :string
# zipcode :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_research_laboratories_on_university_id (university_id)
#
# Foreign Keys
#
# fk_rails_f61d27545f (university_id => universities.id)
Sébastien Gaya
committed
include Sanitizable
has_many :websites,
class_name: 'Communication::Website',
as: :about,
dependent: :nullify
validates :name, :address, :city, :zipcode, :country, presence: true
scope :for_search_term, -> (term) {
where("
unaccent(research_laboratories.address) ILIKE unaccent(:term) OR
unaccent(research_laboratories.city) ILIKE unaccent(:term) OR
unaccent(research_laboratories.country) ILIKE unaccent(:term) OR
unaccent(research_laboratories.name) ILIKE unaccent(:term) OR
def to_s
"#{name}"
end
def full_address
[address, zipcode, city].compact.join ' '
end
def git_path(website)
"data/laboratory.yml"
end
def has_administrators?
false
end
def has_researchers?
# TODO: Ajouter les researchers quand ils existeront
false
end
def has_teachers?
false
end
def has_education_programs?
false
end