lib/hancock_cms.rb in hancock_cms-1.0.2.3 vs lib/hancock_cms.rb in hancock_cms-2.0.0
- old
+ new
@@ -13,47 +13,44 @@
require 'simple_form'
require 'hancock/simple_form_patch'
require 'geocoder'
+# require 'simple_captcha'
+# require 'validates_email_format_of'
require 'filename_to_slug'
require 'codemirror-rails'
require 'rails_admin'
require 'hancock/rails_admin_ext/config'
-require 'hancock/rails_admin_ext/hancock_enum'
-require 'hancock/rails_admin_ext/hancock_enum_with_custom'
-require 'hancock/rails_admin_ext/hancock_array'
require 'hancock/rails_admin_ext/hancock_hash'
require 'hancock/rails_admin_ext/hancock_html'
require 'hancock/rails_admin_ext/hancock_slugs'
require 'hancock/rails_admin_ext/hancock_multiselect'
-require 'hancock/rails_admin_ext/patches/navigation_patch'
require 'hancock/rails_admin_ext/patches/field_patch'
-require 'hancock/rails_admin_ext/patches/fieldset_patch'
require 'hancock/rails_admin_ext/patches/new_controller_patch'
require 'hancock/rails_admin_ext/patches/group_patch'
require 'hancock/rails_admin_ext/patches/hancock_cms_group'
-require 'hancock/rails_admin_ext/patches/has_fields'
require 'rails_admin_nested_set'
require 'rails_admin_toggleable'
require 'ack_rails_admin_settings'
-require 'hancock/rails_admin_settings_patch'
+# require 'x-real-ip'
+
require 'ckeditor'
-require 'kaminari/actionview'
+# require 'kaminari'
+# require 'addressable/uri'
+# require 'turbolinks'
-require 'stickykit/rails'
-
require 'hancock/model'
require 'hancock/engine'
require 'hancock/controller'
@@ -65,28 +62,23 @@
include Hancock::Plugin
class << self
def rails4?
- true
+ false
end
def rails5?
- false
+ true
end
+
def register_model(model)
Hancock::MODELS << model unless Hancock::MODELS.include?(model)
end
- def models_goto_hancock
- MODELS.map { |m|
- puts m.name
- m.goto_hancock
- }
- end
def register_plugin(plugin)
- Hancock::PLUGINS << plugin unless Hancock::PLUGINS.include?(plugin)
+ Hancock::PLUGINS << plugin unless Hancock::MODELS.include?(plugin)
end
def clear_history_from_empty_objects
::HistoryTracker.all.map do |h|
begin
@@ -95,14 +87,14 @@
rescue
h.delete
end
rescue
end
- end if defined?(::HistoryTracker)
+ end
end
def clear_history!
- ::HistoryTracker.delete_all if defined?(::HistoryTracker)
+ ::HistoryTracker.delete_all
end
end
autoload :Migration, 'hancock/migration'