arql 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 811e8dae81062f4ea1204c7c4cebb854242814508548871ee71701e9edcdab75
4
- data.tar.gz: ee843b527ff37e365be55e56f8efc7665a134540a5039c8f802ad4338377bbcf
3
+ metadata.gz: cc32d5a5bb5ea53adc52952b2f8c36e07835a37b36b95561b92e109aead9a586
4
+ data.tar.gz: 8603d556ce8e587bcdcfcabe3ac36e43697f74b2a7e0695722848c6bba7a0efa
5
5
  SHA512:
6
- metadata.gz: 9f7f59f9b49504d801d07080e0b0ee53132efd057560398e186a34d5a2e1c67c31975616aa070fed0b9401c90c3a37a60a7a4537bf3bd74cd4ff10f5b50c9cbb
7
- data.tar.gz: 66ec1f0ba4a2c48ad3e89e145b063be6843edaf1c8e0bdd7412cacbd56d11f2bec4369b9d916dec8940211a1cdf74943e7ec0639484f89332f2b344bcada793d
6
+ metadata.gz: 72434511025ec632cd35fc26d6d4d92225e70b133882561bae3a113aa0cb6c2c7b73947b31c2c8a7cac880f9ac61a043e569dcb0e67dea6fa66a100429cbfc85
7
+ data.tar.gz: 8ef7c8223381c4cc647c23ece0dabb2550a4b9e7270fb684fcaaddd24cd20fefb7f521629695cd955fa2169e2344497bbea5df7716dcd4cef1c5fdb4accfc5c0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arql (0.1.17)
4
+ arql (0.1.18)
5
5
  activerecord (~> 6.0.3)
6
6
  activerecord-oracle_enhanced-adapter
7
7
  activerecord-sqlserver-adapter
data/README.md CHANGED
@@ -284,7 +284,7 @@ ARQL ❯ Person.all.to_a.to_insert_sql
284
284
 
285
285
  #### to_create_sql
286
286
 
287
- You can call `to_create_sql` on any ActiveRecord model clas to get create table SQL of the model class / table.
287
+ You can call `to_create_sql` on any ActiveRecord model class to get create table SQL of the model class / table.
288
288
 
289
289
  #### t
290
290
 
@@ -13,6 +13,22 @@ class Array
13
13
  end.join("\n")
14
14
  end
15
15
 
16
+ def t(*attrs)
17
+ if attrs.present? && present? && first.is_a?(ActiveRecord::Base)
18
+ puts Terminal::Table.new { |t|
19
+ t << attrs
20
+ t << :separator
21
+ each do |e|
22
+ t << e.attributes.values_at(*attrs.map(&:to_s))
23
+ end
24
+ }
25
+ else
26
+ puts Terminal::Table.new { |t|
27
+ v.each { |row| t << (row || :separator)}
28
+ }
29
+ end
30
+ end
31
+
16
32
  def v
17
33
  return self unless present?
18
34
  t = []
@@ -1,3 +1,3 @@
1
1
  module Arql
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.18"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2020-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2
@@ -257,7 +257,7 @@ homepage: https://github.com/lululau/arql
257
257
  licenses:
258
258
  - MIT
259
259
  metadata: {}
260
- post_install_message:
260
+ post_install_message:
261
261
  rdoc_options: []
262
262
  require_paths:
263
263
  - lib
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  version: '0'
274
274
  requirements: []
275
275
  rubygems_version: 3.1.2
276
- signing_key:
276
+ signing_key:
277
277
  specification_version: 4
278
278
  summary: Rails ActiveRecord + Pry is the best SQL query editor
279
279
  test_files: []