sheets_db 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: 57c88ea7accbfcd532ec5ebb0c5f6a368588d95d
4
- data.tar.gz: 5ee07c422165ecad53924dd85bba824a9befc2a0
3
+ metadata.gz: d2d95893f24d4f412a3b06e88a90a18332f2e933
4
+ data.tar.gz: c79d78003dc7a6060c5c99c76b8654fb0aa1dda4
5
5
  SHA512:
6
- metadata.gz: 3775f93d578a0d5e99d0a1617753120f1ee771d37bbed6263b946261f1c8de8ba3f0b2dab651c3bf67865d010d5a04dc1cdbe604aa701d7a38bbeeec58293391
7
- data.tar.gz: 621875e63bfc9bb6f65c72b95704099a8825e2bb9a72d7fc3567e26d5fc8ba832d6ae2a1dee557868048e69ea917a86f2361c099aa45bdb3d39c1328239e50ce
6
+ metadata.gz: 741ac59a7b501a8aaeeaedc19c0c3e0f318a6ff5aebf49a639a3b87b4e7ddf07967ab4b19d9be0a2b0c5f3c23771be507da6ac6a4255ce216fb12f97af6fa759
7
+ data.tar.gz: 3b190abe406276197261802e98f0b6b701e157a95ed1d5da0abae5df98e2a9224d64aaa9f31111a2b1fa6baeed25c581b161595cd30a4af664a264b94ef2a0b2
@@ -6,6 +6,11 @@ module SheetsDB
6
6
  class << self
7
7
  attr_reader :resource_type
8
8
 
9
+ def inherited(subclass)
10
+ super
11
+ subclass.instance_variable_set(:@resource_type, @resource_type)
12
+ end
13
+
9
14
  def set_resource_type(resource_type)
10
15
  @resource_type = resource_type
11
16
  end
@@ -1,3 +1,3 @@
1
1
  module SheetsDB
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -5,12 +5,9 @@ module SheetsDB
5
5
  class AssociationAlreadyRegisteredError < StandardError; end
6
6
 
7
7
  class << self
8
- attr_reader :association_definitions
9
-
10
8
  def inherited(subclass)
11
9
  super
12
10
  subclass.instance_variable_set(:@attribute_definitions, @attribute_definitions)
13
- subclass.instance_variable_set(:@association_definitions, @association_definitions)
14
11
  end
15
12
 
16
13
  def attribute(name, type: String, multiple: false, transform: nil, column_name: nil)
@@ -97,6 +94,10 @@ module SheetsDB
97
94
  def attribute_definitions
98
95
  @attribute_definitions ||= {}
99
96
  end
97
+
98
+ def association_definitions
99
+ attribute_definitions.select { |_, value| value[:association] }
100
+ end
100
101
  end
101
102
 
102
103
  attr_reader :worksheet, :row_position, :loaded_attributes, :loaded_associations, :changed_foreign_items
@@ -241,4 +242,4 @@ module SheetsDB
241
242
  end
242
243
  end
243
244
  end
244
- end
245
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sheets_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ravi Gadad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-24 00:00:00.000000000 Z
11
+ date: 2017-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google_drive
@@ -104,6 +104,7 @@ files:
104
104
  - documentation/example_models/task.rb
105
105
  - documentation/example_models/team.rb
106
106
  - documentation/example_models/user.rb
107
+ - documentation/images/example_erd.graffle
107
108
  - documentation/images/example_erd.png
108
109
  - documentation/images/example_spreadsheet_data.png
109
110
  - documentation/usage.md