golos_cloud 1.0.0alpha → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile.lock +69 -0
- data/README.md +17 -0
- data/Rakefile +263 -0
- data/golos_cloud.gemspec +21 -19
- data/lib/golos_cloud/models/comment.rb +7 -1
- data/lib/golos_cloud/models/tx/account_witness_proxy.rb +13 -1
- data/lib/golos_cloud/version.rb +1 -1
- metadata +66 -6
- data/lib/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1689c3faae3749e73c7209053662c0b78d50ba1
|
4
|
+
data.tar.gz: 070ddf6fab65f14ebb0e0e694183c3e14adc0ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e5e0d66660b0c111077690c12396204093ed6b038571ac56d2691a7b0bf26adef2dca919b2783ff9ebaecbab0e458c8b0d39b19cb1581b882e835a245247ab7
|
7
|
+
data.tar.gz: ee2e34117f9afad0ffeb938ca9358db9045a48d43be17831b688f47ca790bf1c7b3dca98ee9f5523994a537055d722af76cece5014f9d218b7625d90ae13830a
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
golos_cloud (1.0.0)
|
5
|
+
activerecord (>= 4, < 6)
|
6
|
+
activerecord-sqlserver-adapter (>= 4, < 6)
|
7
|
+
nokogiri (~> 1.8)
|
8
|
+
rest-client (~> 2.0)
|
9
|
+
tiny_tds (~> 1.3)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
activemodel (5.1.4)
|
15
|
+
activesupport (= 5.1.4)
|
16
|
+
activerecord (5.1.4)
|
17
|
+
activemodel (= 5.1.4)
|
18
|
+
activesupport (= 5.1.4)
|
19
|
+
arel (~> 8.0)
|
20
|
+
activerecord-sqlserver-adapter (5.1.2)
|
21
|
+
activerecord (~> 5.1.0)
|
22
|
+
tiny_tds
|
23
|
+
activesupport (5.1.4)
|
24
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
|
+
i18n (~> 0.7)
|
26
|
+
minitest (~> 5.1)
|
27
|
+
tzinfo (~> 1.1)
|
28
|
+
arel (8.0.0)
|
29
|
+
awesome_print (1.8.0)
|
30
|
+
concurrent-ruby (1.0.5)
|
31
|
+
domain_name (0.5.20170404)
|
32
|
+
unf (>= 0.0.5, < 1.0.0)
|
33
|
+
http-cookie (1.0.3)
|
34
|
+
domain_name (~> 0.5)
|
35
|
+
i18n (0.9.1)
|
36
|
+
concurrent-ruby (~> 1.0)
|
37
|
+
mime-types (3.1)
|
38
|
+
mime-types-data (~> 3.2015)
|
39
|
+
mime-types-data (3.2016.0521)
|
40
|
+
mini_portile2 (2.3.0)
|
41
|
+
minitest (5.10.3)
|
42
|
+
netrc (0.11.0)
|
43
|
+
nokogiri (1.8.1)
|
44
|
+
mini_portile2 (~> 2.3.0)
|
45
|
+
rake (12.3.0)
|
46
|
+
rest-client (2.0.2)
|
47
|
+
http-cookie (>= 1.0.2, < 2.0)
|
48
|
+
mime-types (>= 1.16, < 4.0)
|
49
|
+
netrc (~> 0.8)
|
50
|
+
thread_safe (0.3.6)
|
51
|
+
tiny_tds (1.3.0)
|
52
|
+
mini_portile2 (~> 2.0)
|
53
|
+
tzinfo (1.2.4)
|
54
|
+
thread_safe (~> 0.1)
|
55
|
+
unf (0.1.4)
|
56
|
+
unf_ext
|
57
|
+
unf_ext (0.0.7.4)
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
ruby
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
awesome_print (~> 1.7, >= 1.7.0)
|
64
|
+
bundler (~> 1.15, >= 1.15.4)
|
65
|
+
golos_cloud!
|
66
|
+
rake (~> 12.1, >= 12.1.0)
|
67
|
+
|
68
|
+
BUNDLED WITH
|
69
|
+
1.16.0.pre.3
|
data/README.md
CHANGED
@@ -39,6 +39,23 @@ reblogs = GolosCloud::Tx::Custom::Reblog
|
|
39
39
|
reblogs.author(:netuoso).today.count
|
40
40
|
```
|
41
41
|
|
42
|
+
### Account Witness Proxy
|
43
|
+
|
44
|
+
How to query current accounts that are actively using a proxy:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
proxied = GolosCloud::Tx::AccountWitnessProxy.active('netuoso')
|
48
|
+
proxied.pluck(:account)
|
49
|
+
```
|
50
|
+
|
51
|
+
### Appiations
|
52
|
+
|
53
|
+
How to query comments by application:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
comments = GolosCloud::Comment.app('esteem').where(author: 'good-karma')
|
57
|
+
```
|
58
|
+
|
42
59
|
### How To Contribute
|
43
60
|
- Fork this repo
|
44
61
|
- Branch off Master and make your changes
|
data/Rakefile
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rake/testtask"
|
3
|
+
require 'golos_cloud'
|
4
|
+
require 'awesome_print'
|
3
5
|
|
4
6
|
Rake::TestTask.new(:test) do |t|
|
5
7
|
t.libs << "test"
|
@@ -20,3 +22,264 @@ end
|
|
20
22
|
task :push do
|
21
23
|
exec "gem push golos_cloud-#{GolosCloud::VERSION}.gem"
|
22
24
|
end
|
25
|
+
|
26
|
+
desc 'Lists sum of transfers grouped by date, from, and to.'
|
27
|
+
task :transfers, [:minimum_amount, :symbol, :days_ago] do |t, args|
|
28
|
+
now = Time.now.utc
|
29
|
+
minimum_amount = (args[:minimum_amount] || '1000000').to_f
|
30
|
+
symbol = (args[:symbol] || 'GOLOS').upcase
|
31
|
+
after_timestamp = now - ((args[:days_ago] || '30').to_i * 86400)
|
32
|
+
|
33
|
+
# Only type: transfer; ignore savings, vestings
|
34
|
+
transfers = GolosCloud::Tx::Transfer.where(type: 'transfer')
|
35
|
+
transfers = transfers.where('amount > ?', minimum_amount)
|
36
|
+
transfers = transfers.where('amount_symbol = ?', symbol)
|
37
|
+
transfers = transfers.where('timestamp > ?', after_timestamp)
|
38
|
+
transfers = transfers.group('CAST(timestamp AS DATE)', :from, :to)
|
39
|
+
transfers = transfers.order('cast_timestamp_as_date ASC')
|
40
|
+
|
41
|
+
puts "Daily transfer sum over #{'%.3f' % minimum_amount} #{symbol} since #{after_timestamp} ..."
|
42
|
+
ap transfers.sum(:amount)
|
43
|
+
end
|
44
|
+
|
45
|
+
desc 'Lists apps grouped by date, app/version.'
|
46
|
+
task :apps, [:app, :days_ago] do |t, args|
|
47
|
+
now = Time.now.utc
|
48
|
+
app = args[:app]
|
49
|
+
after_timestamp = now - ((args[:days_ago] || '7').to_i * 86400)
|
50
|
+
|
51
|
+
comments = GolosCloud::Comment.normalized_json
|
52
|
+
comments = comments.app(app) if !!app
|
53
|
+
comments = comments.where('created > ?', after_timestamp)
|
54
|
+
comments = comments.group('CAST(created AS DATE)', "JSON_VALUE(json_metadata, '$.app')")
|
55
|
+
comments = comments.order('cast_created_as_date ASC')
|
56
|
+
|
57
|
+
matching = " matching \"#{app}\"" if !!app
|
58
|
+
puts "Daily app#{matching} count since #{after_timestamp} ..."
|
59
|
+
ap comments.count(:all)
|
60
|
+
end
|
61
|
+
|
62
|
+
namespace :crosscheck do
|
63
|
+
desc 'List of accounts grouped by transfer count crosschecked by memo of given account.'
|
64
|
+
task :transfers, [:account] do |t, args|
|
65
|
+
exchanges = %w(bittrex poloniex openledger blocktrades)
|
66
|
+
account = args[:account]
|
67
|
+
|
68
|
+
if account.nil? || account == ''
|
69
|
+
puts 'Account name required.'
|
70
|
+
exit
|
71
|
+
elsif exchanges.include? account
|
72
|
+
puts 'That procedure is not recommended.'
|
73
|
+
exit
|
74
|
+
end
|
75
|
+
|
76
|
+
all = GolosCloud::Tx::Transfer.where(type: 'transfer')
|
77
|
+
transfers = all.where(to: exchanges)
|
78
|
+
transfers = if account =~ /%/
|
79
|
+
table = GolosCloud::Tx::Transfer.arel_table
|
80
|
+
transfers.where(table[:from].matches(account))
|
81
|
+
else
|
82
|
+
transfers.where(from: account)
|
83
|
+
end
|
84
|
+
crosscheck_transfers = all.where(memo: transfers.select(:memo))
|
85
|
+
|
86
|
+
if transfers.none?
|
87
|
+
puts "No match."
|
88
|
+
else
|
89
|
+
from = transfers.pluck(:from).uniq.join(', ')
|
90
|
+
puts "Accounts grouped by transfer count using commom memos as #{from} on common exchanges ..."
|
91
|
+
ap crosscheck_transfers.group(:from).order('count_all').count(:all)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
desc 'List of accounts grouped by vesting transfers from a given account'
|
96
|
+
task :vesting_from, [:account] do |t, args|
|
97
|
+
account = args[:account]
|
98
|
+
|
99
|
+
if account.nil? || account == ''
|
100
|
+
puts 'Account name required.'
|
101
|
+
exit
|
102
|
+
end
|
103
|
+
|
104
|
+
table = GolosCloud::Tx::Transfer.arel_table
|
105
|
+
all = GolosCloud::Tx::Transfer.where(type: 'transfer_to_vesting')
|
106
|
+
transfers = all.where(table[:from].not_eq(:to))
|
107
|
+
transfers = transfers.where.not(to: '')
|
108
|
+
transfers = if account =~ /%/
|
109
|
+
table = GolosCloud::Tx::Transfer.arel_table
|
110
|
+
transfers.where(table[:from].matches(account))
|
111
|
+
else
|
112
|
+
transfers.where(from: account)
|
113
|
+
end
|
114
|
+
|
115
|
+
if transfers.none?
|
116
|
+
puts "No match."
|
117
|
+
else
|
118
|
+
from = transfers.pluck(:from).uniq.join(', ')
|
119
|
+
puts "Accounts grouped by vesting transfer count from #{from} ..."
|
120
|
+
ap transfers.group(:to).order('count_all').count(:all)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
desc 'List of accounts grouped by vesting transfers to a given account'
|
125
|
+
task :vesting_to, [:account] do |t, args|
|
126
|
+
account = args[:account]
|
127
|
+
|
128
|
+
if account.nil? || account == ''
|
129
|
+
puts 'Account name required.'
|
130
|
+
exit
|
131
|
+
end
|
132
|
+
|
133
|
+
table = GolosCloud::Tx::Transfer.arel_table
|
134
|
+
all = GolosCloud::Tx::Transfer.where(type: 'transfer_to_vesting')
|
135
|
+
transfers = all.where(table[:from].not_eq(table[:to]))
|
136
|
+
transfers = transfers.where.not(to: '')
|
137
|
+
transfers = if account =~ /%/
|
138
|
+
table = GolosCloud::Tx::Transfer.arel_table
|
139
|
+
transfers.where(table[:to].matches(account))
|
140
|
+
else
|
141
|
+
transfers.where(to: account)
|
142
|
+
end
|
143
|
+
|
144
|
+
if transfers.none?
|
145
|
+
puts "No match."
|
146
|
+
else
|
147
|
+
from = transfers.pluck(:to).uniq.join(', ')
|
148
|
+
puts "Accounts grouped by vesting transfer count to #{from} ..."
|
149
|
+
ap transfers.group(:from).order('count_all').count(:all)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
desc 'List of accounts grouped by powerdown sums crosschecked by given account.'
|
154
|
+
task :powerdowns, [:account] do |t, args|
|
155
|
+
account = args[:account]
|
156
|
+
|
157
|
+
if account.nil? || account == ''
|
158
|
+
puts 'Account name required.'
|
159
|
+
exit
|
160
|
+
end
|
161
|
+
|
162
|
+
table = GolosCloud::Vo::FillVestingWithdraw.arel_table
|
163
|
+
all = GolosCloud::Vo::FillVestingWithdraw.where(table[:from_account].not_eq(table[:to_account]))
|
164
|
+
powerdowns = if account =~ /%/
|
165
|
+
all.where(table[:from_account].matches(account))
|
166
|
+
else
|
167
|
+
all.where(from_account: account)
|
168
|
+
end
|
169
|
+
|
170
|
+
if powerdowns.none?
|
171
|
+
puts "No match."
|
172
|
+
else
|
173
|
+
from = powerdowns.pluck(:from_account).uniq.join(', ')
|
174
|
+
puts "Powerdowns grouped by sum from #{from} ..."
|
175
|
+
ap powerdowns.group(:to_account).
|
176
|
+
order('sum_try_parse_replace_withdrawn_gests_as_float').
|
177
|
+
sum("TRY_PARSE(REPLACE(withdrawn, ' GESTS', '') AS float)")
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
desc 'List of accounts grouped by powerup sums crosschecked by given account.'
|
182
|
+
task :powerups, [:account] do |t, args|
|
183
|
+
account = args[:account]
|
184
|
+
|
185
|
+
if account.nil? || account == ''
|
186
|
+
puts 'Account name required.'
|
187
|
+
exit
|
188
|
+
end
|
189
|
+
|
190
|
+
table = GolosCloud::Vo::FillVestingWithdraw.arel_table
|
191
|
+
all = GolosCloud::Vo::FillVestingWithdraw.where(table[:from_account].not_eq(table[:to_account]))
|
192
|
+
powerups = if account =~ /%/
|
193
|
+
all.where(table[:to_account].matches(account))
|
194
|
+
else
|
195
|
+
all.where(to_account: account)
|
196
|
+
end
|
197
|
+
|
198
|
+
if powerups.none?
|
199
|
+
puts "No match."
|
200
|
+
else
|
201
|
+
to = powerups.pluck(:to_account).uniq.join(', ')
|
202
|
+
puts "Powerups grouped by sum to #{to} ..."
|
203
|
+
ap powerups.group(:from_account).
|
204
|
+
order('sum_try_parse_replace_withdrawn_gests_as_float').
|
205
|
+
sum("TRY_PARSE(REPLACE(withdrawn, ' GESTS', '') AS float)")
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
namespace :rewards do
|
211
|
+
desc 'Lists author rewards grouped by date.'
|
212
|
+
task :author, [:symbol, :days_ago] do |t, args|
|
213
|
+
now = Time.now.utc
|
214
|
+
symbol = (args[:symbol] || 'GBG').upcase
|
215
|
+
after_timestamp = now - ((args[:days_ago] || '7').to_i * 86400)
|
216
|
+
|
217
|
+
rewards = GolosCloud::Vo::AuthorReward
|
218
|
+
rewards = rewards.where('timestamp > ?', after_timestamp)
|
219
|
+
rewards = rewards.group('CAST(timestamp AS DATE)')
|
220
|
+
rewards = rewards.order('cast_timestamp_as_date ASC')
|
221
|
+
|
222
|
+
puts "Daily author reward #{symbol} sum grouped by date since #{after_timestamp} ..."
|
223
|
+
|
224
|
+
case symbol
|
225
|
+
when 'GBG' then ap rewards.sum(:sdb_payout)
|
226
|
+
when 'GOLOS' then ap rewards.sum(:steem_payout)
|
227
|
+
when 'GESTS' then ap rewards.sum(:vesting_payout)
|
228
|
+
when 'MGESTS'
|
229
|
+
ap rewards.sum('vesting_payout / 1000000')
|
230
|
+
else; puts "Unknown symbol: #{symbol}. Symbols supported: GBG, GOLOS, GESTS, MGESTS"
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
desc 'Lists curation rewards grouped by date.'
|
235
|
+
task :curation, [:symbol, :days_ago] do |t, args|
|
236
|
+
now = Time.now.utc
|
237
|
+
symbol = (args[:symbol] || 'MGESTS').upcase
|
238
|
+
after_timestamp = now - ((args[:days_ago] || '7').to_i * 86400)
|
239
|
+
|
240
|
+
rewards = GolosCloud::Vo::CurationReward
|
241
|
+
rewards = rewards.where('timestamp > ?', after_timestamp)
|
242
|
+
rewards = rewards.group('CAST(timestamp AS DATE)')
|
243
|
+
rewards = rewards.order('cast_timestamp_as_date ASC')
|
244
|
+
|
245
|
+
puts "Daily curation reward #{symbol} sum grouped by date since #{after_timestamp} ..."
|
246
|
+
|
247
|
+
case symbol
|
248
|
+
when 'GESTS'
|
249
|
+
ap rewards.sum("TRY_PARSE(REPLACE(reward, ' GESTS', '') AS float)")
|
250
|
+
when 'MGESTS'
|
251
|
+
ap rewards.sum("TRY_PARSE(REPLACE(reward, ' GESTS', '') AS float) / 1000000")
|
252
|
+
else; puts "Unknown symbol: #{symbol}. Symbols supported: GESTS, MGESTS"
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
desc 'Lists proxied grouped by month.'
|
258
|
+
task :proxied, [:days_ago] do |t, args|
|
259
|
+
now = Time.now.utc
|
260
|
+
after_timestamp = now - ((args[:days_ago] || '7').to_i * 86400)
|
261
|
+
|
262
|
+
proxied = GolosCloud::Tx::AccountWitnessProxy
|
263
|
+
proxied = proxied.where('timestamp > ?', after_timestamp)
|
264
|
+
proxied = proxied.group("FORMAT(timestamp, 'yyyy-MM')", :proxy)
|
265
|
+
proxied = proxied.order('format_timestamp_yyyy_mm ASC')
|
266
|
+
|
267
|
+
puts "Daily proxied grouped by month since #{after_timestamp} ..."
|
268
|
+
|
269
|
+
ap proxied.count(:all)
|
270
|
+
end
|
271
|
+
|
272
|
+
# Doesn't look like this table exists.
|
273
|
+
# desc 'List conversion GBG conversion request sums grouped by day.'
|
274
|
+
# task :convert, [:days_ago] do |t, args|
|
275
|
+
# now = Time.now.utc
|
276
|
+
# after_timestamp = now - ((args[:days_ago] || '3.5').to_f * 86400)
|
277
|
+
#
|
278
|
+
# converts = GolosCloud::Vo::FillConvertRequest
|
279
|
+
# converts = converts.where('timestamp > ?', after_timestamp)
|
280
|
+
# converts = converts.group('CAST(timestamp AS DATE)')
|
281
|
+
# converts = converts.order('cast_timestamp_as_date ASC')
|
282
|
+
#
|
283
|
+
# puts "Daily conversion requests failled sum grouped by date since #{after_timestamp} ..."
|
284
|
+
# ap converts.sum(:amount)
|
285
|
+
# end
|
data/golos_cloud.gemspec
CHANGED
@@ -4,26 +4,28 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'golos_cloud/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.authors
|
10
|
-
spec.email
|
7
|
+
spec.name = 'golos_cloud'
|
8
|
+
spec.version = GolosCloud::VERSION
|
9
|
+
spec.authors = ['Anthony Martin']
|
10
|
+
spec.email = ['golos_cloud@martin-studio.com']
|
11
11
|
|
12
|
-
spec.summary
|
13
|
-
spec.description
|
14
|
-
spec.homepage
|
15
|
-
spec.license
|
12
|
+
spec.summary = %q{Ruby/Rails wrapper for golos.cloud}
|
13
|
+
spec.description = %q{Rails compatible gem that provides full DB connection and models to golos.cloud}
|
14
|
+
spec.homepage = 'https://github.com/inertia186/golos_cloud'
|
15
|
+
spec.license = 'WTFPL'
|
16
16
|
|
17
|
-
spec.files
|
18
|
-
|
19
|
-
|
20
|
-
spec.
|
21
|
-
|
22
|
-
spec.
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test)/}) }
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
spec.bindir = 'bin'
|
20
|
+
spec.executables = 'golos_cloud'
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.15', '>= 1.15.4'
|
23
|
+
spec.add_development_dependency 'rake', '~> 12.1', '>= 12.1.0'
|
24
|
+
spec.add_development_dependency 'awesome_print', '~> 1.7', '>= 1.7.0'
|
23
25
|
|
24
|
-
spec.add_runtime_dependency
|
25
|
-
spec.add_runtime_dependency
|
26
|
-
spec.add_runtime_dependency
|
27
|
-
spec.add_runtime_dependency
|
28
|
-
spec.add_runtime_dependency
|
26
|
+
spec.add_runtime_dependency 'nokogiri', ['~> 1.8']
|
27
|
+
spec.add_runtime_dependency 'rest-client', ['~> 2.0']
|
28
|
+
spec.add_runtime_dependency 'activerecord', ['>= 4', '< 6']
|
29
|
+
spec.add_runtime_dependency 'tiny_tds', ['~> 1.3']
|
30
|
+
spec.add_runtime_dependency 'activerecord-sqlserver-adapter', ['>= 4', '< 6']
|
29
31
|
end
|
@@ -7,7 +7,13 @@ module GolosCloud
|
|
7
7
|
scope :after, lambda { |after, field = 'created'| where("#{field} > ?", after) }
|
8
8
|
scope :today, -> { after(1.day.ago) }
|
9
9
|
scope :yesterday, -> { before(1.day.ago).after(2.days.ago) }
|
10
|
-
|
10
|
+
|
11
|
+
scope :normalized_json, -> { where("json_metadata LIKE '{%}'") }
|
12
|
+
|
13
|
+
scope :app, lambda { |app|
|
14
|
+
normalized_json.where("JSON_VALUE(json_metadata, '$.app') LIKE ?", "#{app}/%")
|
15
|
+
}
|
16
|
+
|
11
17
|
def self.find_by_author(user)
|
12
18
|
self.where(author: user)
|
13
19
|
end
|
@@ -3,7 +3,19 @@ module GolosCloud
|
|
3
3
|
class AccountWitnessProxy < GolosCloud::SqlBase
|
4
4
|
|
5
5
|
self.table_name = :TxAccountWitnessProxies
|
6
|
-
|
6
|
+
|
7
|
+
scope :active, lambda { |account = nil|
|
8
|
+
active = all
|
9
|
+
active = active.where(proxy: account) if !!account
|
10
|
+
|
11
|
+
ids = active.map do |p|
|
12
|
+
p.id unless AccountWitnessProxy.where(account: p.account).
|
13
|
+
where.not(proxy: p.Proxy).
|
14
|
+
where('timestamp > ?', p.timestamp).exists?
|
15
|
+
end
|
16
|
+
|
17
|
+
where(id: ids)
|
18
|
+
}
|
7
19
|
end
|
8
20
|
end
|
9
21
|
end
|
data/lib/golos_cloud/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,75 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: golos_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.15'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.15.4
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.15'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.15.4
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rake
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '12.1'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 12.1.0
|
43
|
+
type: :development
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '12.1'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 12.1.0
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: awesome_print
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '1.7'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.7.0
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.7'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 1.7.0
|
13
73
|
- !ruby/object:Gem::Dependency
|
14
74
|
name: nokogiri
|
15
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,6 +163,7 @@ files:
|
|
103
163
|
- ".gitignore"
|
104
164
|
- CODE_OF_CONDUCT.md
|
105
165
|
- Gemfile
|
166
|
+
- Gemfile.lock
|
106
167
|
- LICENSE.txt
|
107
168
|
- README.md
|
108
169
|
- Rakefile
|
@@ -151,7 +212,6 @@ files:
|
|
151
212
|
- lib/golos_cloud/models/vo/interest.rb
|
152
213
|
- lib/golos_cloud/models/vo/shutdown_witness.rb
|
153
214
|
- lib/golos_cloud/version.rb
|
154
|
-
- lib/version.rb
|
155
215
|
- steem_source_docs.md
|
156
216
|
homepage: https://github.com/inertia186/golos_cloud
|
157
217
|
licenses:
|
@@ -168,12 +228,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
228
|
version: '0'
|
169
229
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
230
|
requirements:
|
171
|
-
- - "
|
231
|
+
- - ">="
|
172
232
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
233
|
+
version: '0'
|
174
234
|
requirements: []
|
175
235
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.6.
|
236
|
+
rubygems_version: 2.6.14
|
177
237
|
signing_key:
|
178
238
|
specification_version: 4
|
179
239
|
summary: Ruby/Rails wrapper for golos.cloud
|
data/lib/version.rb
DELETED