lib/cardboard_cms.rb in cardboard_cms-0.2.1 vs lib/cardboard_cms.rb in cardboard_cms-0.2.2

- old
+ new

@@ -23,9 +23,24 @@ def used_as_cms? @used_as_cms = Cardboard::Template.count > 0 if @used_as_cms.nil? #handle false @used_as_cms end + def used_with_pages? + @used_with_pages = Cardboard::Template.where("is_page = ?", true).count > 0 if @used_with_pages.nil? #handle false + @used_with_pages + end + + def used_with_templates? + @used_with_templates = Cardboard::Template.where("is_page = ? OR is_page IS NULL", false).count > 0 if @used_with_templates.nil? #handle false + @used_with_templates + end + + def used_with_settings? + @used_with_settings = Cardboard::Setting.count > 0 if @used_with_settings.nil? #handle false + @used_with_settings + end + def set_resource_controllers # might not be needed in production Dir[Rails.root.join('app/controllers/cardboard/*_controller.rb')].map.each do |controller| require_dependency controller end