Browse Source

renames auth_filter to more generic before_filter since it can be used however you like

Mark Rebec 8 years ago
parent
commit
1ad83144e7

+ 2 - 2
app/controllers/blazer/base_controller.rb

@@ -9,8 +9,8 @@ module Blazer
       http_basic_authenticate_with name: ENV["BLAZER_USERNAME"], password: ENV["BLAZER_PASSWORD"]
     end
 
-    if Blazer.auth_filter
-      before_action Blazer.auth_filter
+    if Blazer.before_filter
+      before_action Blazer.before_filter
     end
 
     layout "blazer/application"

+ 1 - 1
lib/blazer.rb

@@ -13,7 +13,7 @@ module Blazer
     attr_accessor :user_name
     attr_accessor :user_class
     attr_accessor :user_method
-    attr_accessor :auth_filter
+    attr_accessor :before_filter
     attr_accessor :from_email
     attr_accessor :cache
     attr_accessor :transform_statement

+ 1 - 1
lib/blazer/engine.rb

@@ -11,7 +11,7 @@ module Blazer
       Blazer.audit = Blazer.settings.key?("audit") ? Blazer.settings["audit"] : true
       Blazer.user_name = Blazer.settings["user_name"] if Blazer.settings["user_name"]
       Blazer.from_email = Blazer.settings["from_email"] if Blazer.settings["from_email"]
-      Blazer.auth_filter = Blazer.settings["auth_filter"] if Blazer.settings["auth_filter"]
+      Blazer.before_filter = Blazer.settings["before_filter"] if Blazer.settings["before_filter"]
 
       Blazer.user_class ||= Blazer.settings.key?("user_class") ? Blazer.settings["user_class"] : (User rescue nil)
       Blazer.user_method = Blazer.settings["user_method"]

+ 1 - 1
lib/generators/blazer/templates/config.yml

@@ -41,7 +41,7 @@ audit: true
 # user_name: name
 
 # optional auth method to use as a before_action (default: nil)
-# auth_filter: :authenticate!
+# before_filter: :authenticate!
 
 # email to send checks from
 # from_email: blazer@example.org