Skip to content

Commit

Permalink
Merge pull request #133 from tamgrosser/cleanup
Browse files Browse the repository at this point in the history
remove redundant method
  • Loading branch information
kbrock committed Nov 11, 2016
2 parents 708bc61 + a19b7b9 commit 41783b6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/active_hash/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def define_interrogator_method(field)

def define_custom_find_method(field_name)
method_name = :"find_by_#{field_name}"
unless has_singleton_method?(method_name)
unless singleton_methods.include?(method_name)
the_meta_class.instance_eval do
define_method(method_name) do |*args|
args.extract_options!
Expand All @@ -350,7 +350,7 @@ def define_custom_find_method(field_name)

def define_custom_find_all_method(field_name)
method_name = :"find_all_by_#{field_name}"
unless has_singleton_method?(method_name)
unless singleton_methods.include?(method_name)
the_meta_class.instance_eval do
unless singleton_methods.include?(method_name)
define_method(method_name) do |*args|
Expand Down Expand Up @@ -406,12 +406,6 @@ def mark_clean

private :mark_clean

def has_singleton_method?(name)
singleton_methods.map { |method| method.to_sym }.include?(name)
end

private :has_singleton_method?

end

def initialize(attributes = {})
Expand Down

0 comments on commit 41783b6

Please sign in to comment.