Sha256: 2c779b0148e56025fbb223baf294a26d9cd0677ed34cdd6a70ad0becf92236a4
Contents?: true
Size: 610 Bytes
Versions: 9
Compression:
Stored size: 610 Bytes
Contents
class Iro::DatapointsController < Iro::ApplicationController ## params: d, k, v def create authorize! :create, Iro::Datapoint begin Iro::Datapoint.create!( date: params[:d], kind: params[:k], value: params[:v], ) render json: { status: :ok } rescue Mongoid::Errors::Validations => e render json: { status: 401 }, status: 401 end end def index authorize! :datapoints_index, Iro @symbol = params[:symbol] || params[:q] @datapoints = Iro::Datapoint.where( symbol: @symbol ).order_by( quote_at: :desc ).limit(100) end end
Version data entries
9 entries across 9 versions & 1 rubygems