Sha256: 9d6fcc8a886a7185630a7d6605139bb8aeece2dfe4dc5355a41338972381e931
Contents?: true
Size: 1.24 KB
Versions: 44
Compression:
Stored size: 1.24 KB
Contents
require_dependency "ishapi/application_controller" module Ishapi class OptionPriceItemsController < ApplicationController # before_action :soft_check_long_term_token, only: [ :show ] # before_action :check_jwt ## params: symbol, begin_at, end_at def view authorize! :view_chain, ::Iro::OptionPriceItem.new @opis = ::Iro::OptionPriceItem.where({ ticker: params[:symbol] }).where( "timestamp BETWEEN ? and ? ", params[:begin_at], params[:end_at] ).limit(100) end def view_by_symbol authorize! :view_chain, ::Iro::OptionPriceItem.new @opis = ::Iro::OptionPriceItem.where({ symbol: params[:symbol] }).limit(100) render 'view' end end end ## this is in scratchpadjs / done =begin SELECT symbol, bid, ask, MAX(`timestamp`) as a FROM iwa_option_price_items where symbol = "GME_021023P20" GROUP BY symbol, bid, ask, DATE(`timestamp`), HOUR(`timestamp`), Minute(`timestamp`) order by a desc; SELECT symbol, MAX(`timestamp`) as a FROM iwa_option_price_items where symbol = "GME_021023P20" GROUP BY symbol, DATE(`timestamp`), HOUR(`timestamp`), Minute(`timestamp`) order by a desc; select timestamp as a FROM iwa_option_price_items where symbol = "GME_021023P20" order by a desc; =end
Version data entries
44 entries across 44 versions & 1 rubygems