lib/enjoy_cms.rb in enjoy_cms-0.1.0.beta1 vs lib/enjoy_cms.rb in enjoy_cms-0.2.0.beta

- old
+ new

@@ -1,7 +1,7 @@ unless defined?(Enjoy) && Enjoy.respond_to?(:orm) && [:active_record, :mongoid].include?(Enjoy.orm) - puts "please use Enjoy_mongoid or Enjoy_activerecord and not enjoy directly" + puts "please use enjoy_cms_mongoid or enjoy_cms_activerecord and not enjoy directly" exit 1 end require 'enjoy/version' require 'devise' @@ -37,13 +37,11 @@ require 'enjoy/model' require 'enjoy/rails_admin_menu' require 'enjoy/engine' require 'enjoy/controller' -require 'manual_slug' - module Enjoy class << self def mongoid? Enjoy.orm == :mongoid end @@ -63,37 +61,40 @@ # module Mongoid # autoload :Paperclip 'enjoy/mongoid/paperlcip' # end module Models + autoload :SitemapData, 'enjoy/models/sitemap_data' autoload :Seo, 'enjoy/models/seo' autoload :Menu, 'enjoy/models/menu' autoload :Page, 'enjoy/models/page' autoload :News, 'enjoy/models/news' autoload :ContactMessage, 'enjoy/models/contact_message' - autoload :Enjoy, 'enjoy/models/embedded_element' + autoload :EmbeddedElement, 'enjoy/models/embedded_element' autoload :EmbeddedGalleryImage, 'enjoy/models/embedded_gallery_image' autoload :GalleryImage, 'enjoy/models/gallery_image' autoload :Gallery, 'enjoy/models/gallery' module Mongoid + autoload :SitemapData, 'enjoy/models/mongoid/sitemap_data' autoload :Seo, 'enjoy/models/mongoid/seo' autoload :Menu, 'enjoy/models/mongoid/menu' autoload :Page, 'enjoy/models/mongoid/page' autoload :News, 'enjoy/models/mongoid/news' autoload :ContactMessage, 'enjoy/models/mongoid/contact_message' - autoload :Enjoy, 'enjoy/models/mongoid/embedded_element' + autoload :EmbeddedElement, 'enjoy/models/mongoid/embedded_element' autoload :EmbeddedGalleryImage, 'enjoy/models/mongoid/embedded_gallery_image' autoload :GalleryImage, 'enjoy/models/mongoid/gallery_image' autoload :Gallery, 'enjoy/models/mongoid/gallery' end module ActiveRecord + autoload :SitemapData, 'enjoy/models/active_record/sitemap_data' autoload :Seo, 'enjoy/models/active_record/seo' autoload :Menu, 'enjoy/models/active_record/menu' autoload :Page, 'enjoy/models/active_record/page' autoload :News, 'enjoy/models/active_record/news' autoload :ContactMessage, 'enjoy/models/active_record/contact_message' @@ -105,5 +106,7 @@ autoload :News, 'enjoy/controllers/news' autoload :Pages, 'enjoy/controllers/pages' autoload :Search, 'enjoy/controllers/search' end end + +require 'manual_slug'