Class: WorldDb::Model::Continent

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/worlddb/models/forward.rb,
lib/worlddb/models/continent.rb

Instance Method Summary collapse

Instance Method Details

#on_createObject



25
26
27
28
29
30
# File 'lib/worlddb/models/continent.rb', line 25

def on_create
  place_rec = Place.create!( name: name, kind: place_kind )
  self.place_id = place_rec.id 

  self.slug = TextUtils.slugify( name )  if slug.blank?
end

#on_updateObject



32
33
34
35
36
37
38
# File 'lib/worlddb/models/continent.rb', line 32

def on_update
  ## fix/todo: check - if name or kind changed - only update if changed ?? why? why not??
  place.update_attributes!( name: name, kind: place_kind )
  
  ## check if name changed -- possible?
  ## update slug too??
end

#place_kindObject

use place_kind_of_code ??



40
41
42
# File 'lib/worlddb/models/continent.rb', line 40

def place_kind   # use place_kind_of_code ??
  'CONT'
end

#synonymsObject



15
# File 'lib/worlddb/models/continent.rb', line 15

def synonyms()       alt_names;              end

#synonyms=(value) ⇒ Object



16
# File 'lib/worlddb/models/continent.rb', line 16

def synonyms=(value) self.alt_names = value; end

#titleObject

begin compat



12
# File 'lib/worlddb/models/continent.rb', line 12

def title()       name;              end

#title=(value) ⇒ Object



13
# File 'lib/worlddb/models/continent.rb', line 13

def title=(value) self.name = value; end