Class: ActiveRecord::DynamicMatchers::FindBy

Inherits:
Method show all
Defined in:
activerecord/lib/active_record/dynamic_matchers.rb

Class Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Method

define, match, valid?

Class Attribute Details

.patternObject (readonly)

Returns the value of attribute pattern.



78
79
80
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 78

def pattern
  @pattern
end

Class Method Details

.finderObject



84
85
86
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 84

def finder
  "find_by"
end

.match?(name) ⇒ Boolean

Returns:

  • (Boolean)


80
81
82
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 80

def match?(name)
  pattern.match?(name) && self
end