rasti-db 1.2.0 → 1.3.0

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
- SHA1:
3
- metadata.gz: 8d134f095bd5c09bb827c9a1b51b2a1a10dc333b
4
- data.tar.gz: 9e70fd2c3b67c5039530ce14f391f6fd572c26fa
2
+ SHA256:
3
+ metadata.gz: aab2813290f3080c9a50cfed449183cc5da14e04915f6593fa9ab7fa5e5f24a7
4
+ data.tar.gz: 3d46e38905af30b1a50a8b186b5ebf3f3253db29b58eed2526859c12862cc8af
5
5
  SHA512:
6
- metadata.gz: 68982576814409051789fef84204e31acebb4c21c2a1b52e9c3de30870cb738eaa70e5f03c7661ea46994a73ff2f9303da956c5bf693bde82f028592ee2fc3d3
7
- data.tar.gz: 9dd4ac963e7cfaed91684a26981484941f25f06dba345c656dda600bc95254f75dbe248f43e571f4309ce6b810580493cc2e496ab6a771251abd4981bd21cc5a
6
+ metadata.gz: 5ae412446ff6d62b5cd1043e1958aaafe7dbc391ba98173adcc6ab5b31ce0d1daa8dc7086b62ae27ca50b7c03e6c2a1f6ac905a06a30a932a5e367e30698d8cd
7
+ data.tar.gz: 68e99deac8ffb297263a56a1e3f4deff341518f94aba48bbbb8a760983e86d9268a9a7d96a36626ca7fcf4173c512f23c3585bcbae047dc964de493b2a7256e4
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.4.5
1
+ ruby-2.6.0
@@ -16,6 +16,10 @@ module Rasti
16
16
  @collection_name ||= underscore(demodulize(name)).to_sym
17
17
  end
18
18
 
19
+ def collection_fields
20
+ @collection_fields ||= model.attributes - relations.keys
21
+ end
22
+
19
23
  def primary_key
20
24
  @primary_key ||= :id
21
25
  end
@@ -1,5 +1,5 @@
1
1
  module Rasti
2
2
  module DB
3
- VERSION = '1.2.0'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  end
@@ -6,6 +6,7 @@ describe 'Collection' do
6
6
 
7
7
  it 'Implicit' do
8
8
  Users.collection_name.must_equal :users
9
+ Users.collection_fields.must_equal [:id, :name]
9
10
  Users.model.must_equal User
10
11
  Users.primary_key.must_equal :id
11
12
  Users.foreign_key.must_equal :user_id
@@ -13,6 +14,7 @@ describe 'Collection' do
13
14
 
14
15
  it 'Explicit' do
15
16
  People.collection_name.must_equal :people
17
+ People.collection_fields.must_equal [:document_number, :first_name, :last_name, :birth_date, :user_id]
16
18
  People.model.must_equal Person
17
19
  People.primary_key.must_equal :document_number
18
20
  People.foreign_key.must_equal :document_number
@@ -5,5 +5,7 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [SimpleCov::Forma
5
5
 
6
6
  SimpleCov.start do
7
7
  add_filter 'lib/rasti/db/nql/syntax.rb'
8
- add_filter 'spec/'
8
+
9
+ add_group 'Rasti::DB', 'lib'
10
+ add_group 'Spec', 'spec'
9
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasti-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-28 00:00:00.000000000 Z
11
+ date: 2019-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -336,8 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
336
336
  - !ruby/object:Gem::Version
337
337
  version: '0'
338
338
  requirements: []
339
- rubyforge_project:
340
- rubygems_version: 2.5.1
339
+ rubygems_version: 3.0.1
341
340
  signing_key:
342
341
  specification_version: 4
343
342
  summary: Database collections and relations