Class: Relation

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for_companyObject



15
16
17
# File 'app/models/relation.rb', line 15

def self.for_company
  where(:person_can_be_company => true)
end

.for_individualObject



11
12
13
# File 'app/models/relation.rb', line 11

def self.for_individual
  where(:person_can_be_individual => true)
end

.for_type(type) ⇒ Object



19
20
21
# File 'app/models/relation.rb', line 19

def self.for_type(type)
  send("for_#{type.downcase}")
end

Instance Method Details

#indefinite_articleObject



23
24
25
# File 'app/models/relation.rb', line 23

def indefinite_article
  %w(a e i o u).include?(description[0].downcase) ? 'an' : 'a'
end