Class: Radiant::Exporter

Inherits:
Object show all
Defined in:
app/models/radiant/exporter.rb

Class Method Summary collapse

Class Method Details

.exportObject



3
4
5
6
7
8
9
# File 'app/models/radiant/exporter.rb', line 3

def self.export
  hash = {}
  [Radiant::Config, User, Page, PagePart, Snippet, Layout].each do |klass|
    hash[klass.name.pluralize] = klass.find(:all).inject({}) { |h, record| h[record.id.to_i] = record.attributes; h }
  end
  hash.to_yaml
end