aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2017-01-05 17:20:57 +0900
committerAkira Matsuda <ronnie@dio.jp>2017-01-05 19:58:52 +0900
commit5473e390d362755125d2f47b64ef0a135f2fe111 (patch)
treeb9c199a3c78ad307ed034cf5618e2897dfa650c6 /actionpack
parent6197a38bca988f05087aa022e288922cf0331d6c (diff)
downloadrails-5473e390d362755125d2f47b64ef0a135f2fe111.tar.gz
rails-5473e390d362755125d2f47b64ef0a135f2fe111.tar.bz2
rails-5473e390d362755125d2f47b64ef0a135f2fe111.zip
`self.` is not needed when calling its own instance method
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/head.rb2
-rw-r--r--actionpack/lib/action_controller/metal/rendering.rb2
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb2
-rw-r--r--actionpack/lib/action_controller/test_case.rb2
-rw-r--r--actionpack/test/controller/integration_test.rb4
-rw-r--r--actionpack/test/controller/url_for_test.rb2
-rw-r--r--actionpack/test/dispatch/routing_test.rb2
7 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/head.rb b/actionpack/lib/action_controller/metal/head.rb
index 4dff23dd85..0c50894bce 100644
--- a/actionpack/lib/action_controller/metal/head.rb
+++ b/actionpack/lib/action_controller/metal/head.rb
@@ -37,7 +37,7 @@ module ActionController
if include_content?(response_code)
self.content_type = content_type || (Mime[formats.first] if formats)
- self.response.charset = false
+ response.charset = false
end
true
diff --git a/actionpack/lib/action_controller/metal/rendering.rb b/actionpack/lib/action_controller/metal/rendering.rb
index 4c01891d4c..6b17719381 100644
--- a/actionpack/lib/action_controller/metal/rendering.rb
+++ b/actionpack/lib/action_controller/metal/rendering.rb
@@ -114,7 +114,7 @@ module ActionController
self.status = status if status
self.content_type = content_type if content_type
- self.headers["Location"] = url_for(location) if location
+ headers["Location"] = url_for(location) if location
super
end
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index acfeca1fcb..6e8df02fb9 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -150,7 +150,7 @@ module ActionController
# permitted flag.
def ==(other)
if other.respond_to?(:permitted?)
- self.permitted? == other.permitted? && self.parameters == other.parameters
+ permitted? == other.permitted? && parameters == other.parameters
else
@parameters == other
end
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index 441667e556..7b620ac95e 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -354,7 +354,7 @@ module ActionController
end
def controller_class
- if current_controller_class = self._controller_class
+ if current_controller_class = _controller_class
current_controller_class
else
self.controller_class = determine_default_controller_class(name)
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 4fae4071b1..cd1415b56c 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -269,8 +269,8 @@ class IntegrationProcessTest < ActionDispatch::IntegrationTest
test "response cookies are added to the cookie jar for the next request" do
with_test_route_set do
- self.cookies["cookie_1"] = "sugar"
- self.cookies["cookie_2"] = "oatmeal"
+ cookies["cookie_1"] = "sugar"
+ cookies["cookie_2"] = "oatmeal"
get "/cookie_monster"
assert_equal "cookie_1=; path=/\ncookie_3=chocolate; path=/", headers["Set-Cookie"]
assert_equal({ "cookie_1" => "", "cookie_2" => "oatmeal", "cookie_3" => "chocolate" }, cookies.to_hash)
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb
index 382b4e273d..862dcf01c3 100644
--- a/actionpack/test/controller/url_for_test.rb
+++ b/actionpack/test/controller/url_for_test.rb
@@ -26,7 +26,7 @@ module AbstractController
action: :index
}
}.url_helpers
- self.default_url_options[:host] = "example.com"
+ default_url_options[:host] = "example.com"
}
path = klass.new.fun_path(controller: :articles,
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 474d053af6..53758a4fbc 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -1603,7 +1603,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
get "account/login", to: redirect("/login")
end
- previous_host, self.host = self.host, "www.example.com:3000"
+ previous_host, self.host = host, "www.example.com:3000"
get "/account/login"
verify_redirect "http://www.example.com:3000/login"