28 lines
698 B
Ruby
28 lines
698 B
Ruby
require "merged/version"
|
|
require "merged/engine"
|
|
require "generators/install/install_generator"
|
|
require "generators/merged/update/update_generator"
|
|
|
|
module Merged
|
|
|
|
# Directory inside the app/assets/images
|
|
mattr_accessor :image_path
|
|
@@image_path = "cms"
|
|
|
|
# directory in root to store data
|
|
mattr_accessor :data_path
|
|
@@image_path = "merged"
|
|
|
|
def self.load_data
|
|
# pre-load data
|
|
[OptionDefinition, CardStyle, SectionStyle , PageStyle,
|
|
Card , Section , Page , Image].each {|clazz| clazz.all }
|
|
end
|
|
|
|
def self.load_from( kind , path )
|
|
return unless File.exists?(path)
|
|
clazz = "Merged::#{kind.camelcase}".constantize
|
|
clazz.load(YAML.load_file( path ))
|
|
end
|
|
end
|