Class: Radiant::Exporter
Class Method Summary collapse
Class Method Details
.export ⇒ Object
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 |