Class: Newsletter::Area
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Newsletter::Area
- Includes:
- Deleteable
- Defined in:
- app/models/newsletter/area.rb
Instance Attribute Summary collapse
-
#should_destroy ⇒ Object
Returns the value of attribute should_destroy.
Class Method Summary collapse
-
.import(design, data) ⇒ Object
builds areas from data pulled out of an exported YAML file by Newsletter::Design.import(class).
Instance Method Summary collapse
-
#export_fields ⇒ Object
returns field data so that Newsletter::Design.export(instance) can export itself to a YAML file.
Methods included from Deleteable
#delete, included, #is_deleted?, #undelete
Instance Attribute Details
#should_destroy ⇒ Object
Returns the value of attribute should_destroy.
19 20 21 |
# File 'app/models/newsletter/area.rb', line 19 def should_destroy @should_destroy end |
Class Method Details
.import(design, data) ⇒ Object
builds areas from data pulled out of an exported YAML file by Newsletter::Design.import(class)
40 41 42 43 44 |
# File 'app/models/newsletter/area.rb', line 40 def self.import(design,data) area = Area.create(:name => data[:name], :description => data[:description]) area.design = design area.save end |
Instance Method Details
#export_fields ⇒ Object
returns field data so that Newsletter::Design.export(instance) can export itself to a YAML file
33 34 35 36 37 |
# File 'app/models/newsletter/area.rb', line 33 def export_fields { :name => name, :description => description } end |