Module: Similar

Extended by:
ActiveSupport::Concern
Included in:
ActiveConsole
Defined in:
lib/active_console/similar.rb

Instance Method Summary collapse

Instance Method Details

#similar(*columns) ⇒ Object



4
5
6
7
8
# File 'lib/active_console/similar.rb', line 4

def similar(*columns)
  attributes = {}
  columns.each { |c| attributes[c] = self.send(c) }
  self.class.where(attributes)
end