Class: Polyblock::Block
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Polyblock::Block
- Defined in:
- app/models/polyblock/block.rb
Class Method Summary collapse
Class Method Details
.export ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/models/polyblock/block.rb', line 12 def self.export output = Block.all.as_json(:except => [:id, :created_at, :updated_at]) puts "" puts "Run the following in Rails Console on the remote server:" puts "" puts "Polyblock::Block.import(#{output})" puts "" end |
.import(pbs) ⇒ Object
8 9 10 |
# File 'app/models/polyblock/block.rb', line 8 def self.import(pbs) pbs.each{|pb| Block.create(pb) } end |