iron_warbler 2.0.7.34 → 2.0.7.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aec6ab45a677eba7e1467fd0088a5e46b87eb91dad52002df219bad56c26429
4
- data.tar.gz: adf78ae8f2550592040dda80481438a9a6e60504097e572485d9f2aa5fbd7537
3
+ metadata.gz: cd6aac35369c50f31620e5789277576c5583fe794a1426306cee25fc3fc05d88
4
+ data.tar.gz: c17dbf154ed517eb8f12a9381f4f95b3eda24790d5551028434ecaf8b9c9df80
5
5
  SHA512:
6
- metadata.gz: a2347d585dfd6e7b425c6592e8a8c6d56ec241101489942e00bcac026dad091770003bbb9e03d28d80d0ed8ce7f6f06227efaf8233fb4953ac92c67e3354aaca
7
- data.tar.gz: df2ba85e9ad79a6ecb16adb1da5d2b548750dfd7d403f3bafc4718a47cdf0f5c80b5d4af6ac829e18071da0a9a3987afa26a2a0b1ab83b36a511d1aeee755653
6
+ metadata.gz: 11aeb5d8617e158e6a4e592dd401b59650f226e60100c31a8a2b48fe8cf3d7ba101ea7c404ad24ada2933bf8abbc38c8fac5bea075d3694e0e7bf15712c8dc32
7
+ data.tar.gz: d250b26d4f5be51875ec567c4a50da88eef68609bec3936a50fcec52a519ebc21131c3c427a4f42564f8d921009c868c5268bc564566891a55799c0263ce7b9c
@@ -17,23 +17,9 @@ class Iro::DatapointsController < Iro::ApplicationController
17
17
  end
18
18
 
19
19
  def index
20
- # from = '2023-12-20'
21
- # to = '2023-12-01'
22
- # points = Iro::Datapoint.where( k: params[:k] ).joins( :dates )
23
-
24
- sql = "SELECT
25
- dps.k, dps.v, d.date
26
- FROM
27
- iro_datapoints as dps
28
- RIGHT JOIN dates d ON d.date = dps.d WHERE d.date BETWEEN '2023-12-01' AND '2023-12-31'
29
- ORDER BY
30
- d.date;"
31
-
32
- # outs = ActiveRecord::Base.connection.execute(sql)
33
- # puts! outs, 'outs'
34
-
35
- render json: outs
36
-
20
+ authorize! :datapoints_index, Iro
21
+ @symbol = params[:symbol] || params[:q]
22
+ @datapoints = Iro::Datapoint.where( symbol: @symbol ).order_by( quote_at: :desc ).limit(100)
37
23
  end
38
24
 
39
25
  end
@@ -37,5 +37,11 @@
37
37
  %li
38
38
  = link_to s, strategy_path(s)
39
39
  = link_to '[~]', edit_strategy_path(s)
40
+ .a
41
+ %ul
42
+ %li
43
+ Datapoints
44
+ = form_tag datapoints_by_symbol_path, method: :get do
45
+ = text_field_tag :q
40
46
 
41
47
 
@@ -0,0 +1,14 @@
1
+
2
+ .datapoints-index.maxwidth
3
+ .header
4
+ %h3.title= @symbol
5
+
6
+ %table.bordered.padded
7
+ %thead
8
+ %th quote_at
9
+ %th value
10
+ %tbody
11
+ - @datapoints.each do |point|
12
+ %tr
13
+ %td= pp_datetime point.quote_at
14
+ %td= point.value
data/config/routes.rb CHANGED
@@ -6,6 +6,8 @@ Iro::Engine.routes.draw do
6
6
 
7
7
  post 'datapoints', to: '/iro/datapoints#create'
8
8
  get 'datapoints', to: '/iro/datapoints#index'
9
+ get 'datapoints/by-symbol', to: '/iro/datapoints#index'
10
+ get 'datapoints/by-symbol/:symbol', to: '/iro/datapoints#index'
9
11
 
10
12
  resources :option_watches
11
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7.34
4
+ version: 2.0.7.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
@@ -262,6 +262,7 @@ files:
262
262
  - app/views/iro/api/stocks/show.json.jbuilder
263
263
  - app/views/iro/api/stocks/show.json.jbuilder-bk
264
264
  - app/views/iro/application/home.haml
265
+ - app/views/iro/datapoints/index.haml
265
266
  - app/views/iro/options/_show_mini.haml
266
267
  - app/views/iro/positions/_form.haml
267
268
  - app/views/iro/positions/_formpart_4data.haml