Prechádzať zdrojové kódy

renames before_filter to before_action to follow rails conventions

Mark Rebec 8 rokov pred
rodič
commit
246e009f55

+ 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.before_filter
-      before_action Blazer.before_filter
+    if Blazer.before_action
+      before_action Blazer.before_action
     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 :before_filter
+    attr_accessor :before_action
     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.before_filter = Blazer.settings["before_filter"] if Blazer.settings["before_filter"]
+      Blazer.before_action = Blazer.settings["before_action"] if Blazer.settings["before_action"]
 
       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)
-# before_filter: :authenticate!
+# before_action: :authenticate!
 
 # email to send checks from
 # from_email: blazer@example.org