Class: SteelWheel::Query

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations, Memery
Defined in:
lib/steel_wheel/query.rb

Overview

Base class for queries

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.nameObject



9
10
11
# File 'lib/steel_wheel/query.rb', line 9

def self.name
  'SteelWheel::Query'
end

Instance Method Details

#http_statusObject



13
14
15
16
17
18
# File 'lib/steel_wheel/query.rb', line 13

def http_status
  return :ok if errors.empty?
  return errors.keys.first unless defined?(ActiveModel::Error)

  errors.map(&:type).first
end