diff --git a/app/models/foreman_chef/fact_importer.rb b/app/models/foreman_chef/fact_importer.rb
index <HASH>..<HASH> 100644
--- a/app/models/foreman_chef/fact_importer.rb
+++ b/app/models/foreman_chef/fact_importer.rb
@@ -75,7 +75,7 @@ module ForemanChef
     end
 
     def fact_names
-      @fact_names ||= fact_name_class.maximum(:id, :group => 'name')
+      @fact_names ||= fact_name_class.group(:name).maximum(:id)
     end
 
     # if the host does not exists yet, we don't have an host_id to use the fact_values table.
diff --git a/lib/foreman_chef/engine.rb b/lib/foreman_chef/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/foreman_chef/engine.rb
+++ b/lib/foreman_chef/engine.rb
@@ -28,7 +28,7 @@ module ForemanChef
 
     initializer 'foreman_chef.register_plugin', :after => :finisher_hook do |app|
       Foreman::Plugin.register :foreman_chef do
-        requires_foreman '>= 1.9'
+        requires_foreman '>= 1.11'
         allowed_template_helpers :chef_bootstrap
       end
     end
Fixes #<I> - rails 4 compatibility in facts importing