Permalink
Browse files

Fix rubocop Issues: Lint/UnusedMethodArgument

  • Loading branch information...
1 parent 286a661 commit bf74866282a106bf952eaa9718e55c6302c15ca7 @zorafuchs zorafuchs committed with schmijos Dec 20, 2016
View
@@ -34,16 +34,6 @@ Lint/ShadowingOuterLocalVariable:
- 'lib/cancan/model_adapters/active_record_adapter.rb'
- 'lib/cancan/model_adapters/sequel_adapter.rb'
-# Offense count: 16
-# Cop supports --auto-correct.
-# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
-Lint/UnusedMethodArgument:
- Exclude:
- - 'lib/cancan/controller_additions.rb'
- - 'lib/cancan/model_adapters/abstract_adapter.rb'
- - 'lib/cancan/model_adapters/active_record_4_adapter.rb'
- - 'lib/cancan/model_adapters/sequel_adapter.rb'
-
# Offense count: 36
Lint/UselessAssignment:
Exclude:
@@ -279,7 +279,7 @@ def skip_authorization_check(*args)
self.send(method_name, *args, &block)
end
- def skip_authorization(*args)
+ def skip_authorization(*_args)
raise ImplementationRemoved, 'The CanCan skip_authorization method has been renamed to skip_authorization_check. Please update your code.'
end
@@ -342,7 +342,7 @@ def authorize!(*args)
current_ability.authorize!(*args)
end
- def unauthorized!(message = nil)
+ def unauthorized!(_message = nil)
raise ImplementationRemoved, 'The unauthorized! method has been removed from CanCan, use authorize! instead.'
end
@@ -11,7 +11,7 @@ def self.adapter_class(model_class)
end
# Used to determine if the given adapter should be used for the passed in class.
- def self.for_class?(member_class)
+ def self.for_class?(_member_class)
false # override in subclass
end
@@ -22,23 +22,23 @@ def self.find(model_class, id)
# Used to determine if this model adapter will override the matching behavior for a hash of conditions.
# If this returns true then matches_conditions_hash? will be called. See Rule#matches_conditions_hash
- def self.override_conditions_hash_matching?(subject, conditions)
+ def self.override_conditions_hash_matching?(_subject, _conditions)
false
end
# Override if override_conditions_hash_matching? returns true
- def self.matches_conditions_hash?(subject, conditions)
+ def self.matches_conditions_hash?(_subject, _conditions)
raise NotImplemented, 'This model adapter does not support matching on a conditions hash.'
end
# Used to determine if this model adapter will override the matching behavior for a specific condition.
# If this returns true then matches_condition? will be called. See Rule#matches_conditions_hash
- def self.override_condition_matching?(subject, name, value)
+ def self.override_condition_matching?(_subject, _name, _value)
false
end
# Override if override_condition_matching? returns true
- def self.matches_condition?(subject, name, value)
+ def self.matches_condition?(_subject, _name, _value)
raise NotImplemented, 'This model adapter does not support matching on a specific condition.'
end
@@ -18,7 +18,7 @@ def build_relation(*where_conditions)
relation
end
- def self.override_condition_matching?(subject, name, value)
+ def self.override_condition_matching?(subject, name, _value)
# ActiveRecord introduced enums in version 4.1.
(ActiveRecord::VERSION::MAJOR > 4 || ActiveRecord::VERSION::MINOR >= 1) &&
subject.class.defined_enums.include?(name.to_s)
@@ -9,7 +9,7 @@ def self.find(model_class, id)
model_class[id]
end
- def self.override_condition_matching?(subject, name, value)
+ def self.override_condition_matching?(_subject, _name, value)
value.kind_of?(Hash)
end

0 comments on commit bf74866

Please sign in to comment.