Sha256: a93fd2f725fbbc310ee8dcf7a95615298f5684e3c859b3b73b0affea4d493efe

Contents?: true

Size: 315 Bytes

Versions: 33

Compression:

Stored size: 315 Bytes

Contents

module Radiant
  class Exporter
    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
  end
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
radiant-0.6.1 app/models/radiant/exporter.rb
radiant-0.6.2 app/models/radiant/exporter.rb
radiant-0.6.3 app/models/radiant/exporter.rb
radiant-0.6.4 app/models/radiant/exporter.rb
radiant-0.6.5.1 app/models/radiant/exporter.rb
radiant-0.6.5 app/models/radiant/exporter.rb
radiant-0.6.7 app/models/radiant/exporter.rb
radiant-0.6.6 app/models/radiant/exporter.rb
radiant-0.6.8 app/models/radiant/exporter.rb
radiant-0.6.9 app/models/radiant/exporter.rb
radiant-0.7.0 app/models/radiant/exporter.rb
radiant-0.8.0 app/models/radiant/exporter.rb
radiant-0.7.1 app/models/radiant/exporter.rb