module ActiveRecord::PatternMatch
Public Instance Methods
deconstruct_keys(keys)
click to toggle source
# File lib/activerecord/pattern_match.rb, line 8 def deconstruct_keys(keys) attributes.transform_keys(&:to_sym).select { keys.include?(_1) } end
respond_to?(name, *args)
click to toggle source
MEMO: respond_to? is defined ActiveRecord
redefine respond_to? because it is not called in refinments
Calls superclass method
# File lib/activerecord/pattern_match.rb, line 14 def respond_to?(name, *args) name == :deconstruct_keys || super(name, *args) end