Class: WorldDb::Model::Continent
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- WorldDb::Model::Continent
- Defined in:
- lib/worlddb/models/forward.rb,
lib/worlddb/models/continent.rb
Instance Method Summary collapse
- #on_create ⇒ Object
- #on_update ⇒ Object
-
#place_kind ⇒ Object
use place_kind_of_code ??.
- #synonyms ⇒ Object
- #synonyms=(value) ⇒ Object
-
#title ⇒ Object
begin compat.
- #title=(value) ⇒ Object
Instance Method Details
#on_create ⇒ Object
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_update ⇒ Object
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_kind ⇒ Object
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 |
#synonyms ⇒ Object
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 |
#title ⇒ Object
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 |