Class: Agent

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Redis::Objects::RMap
Defined in:
app/models/agent.rb

Class Method Summary collapse

Class Method Details

.as_hash(fields) ⇒ Object



24
25
26
27
28
# File 'app/models/agent.rb', line 24

def self.as_hash(fields)
  connection.select_all(select(fields).arel).each do |attrs|
    yield(attrs) if block_given?
  end
end