Class: Io::ActiveRecord::Relation

Inherits:
Object
  • Object
show all
Extended by:
Core::Io::Collection
Defined in:
app/api/io/active_record/relation.rb

Class Method Summary collapse

Class Method Details

.as_json(options = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'app/api/io/active_record/relation.rb', line 6

def as_json(options = {})
  options[:handled_by].generate_json_actions(
    options[:object],
    options.merge(target: options[:response].request.target)
  )
  super
end

.size_for(results) ⇒ Object



14
15
16
# File 'app/api/io/active_record/relation.rb', line 14

def size_for(results)
  results.count
end