sheets_db 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/documentation/images/example_erd.graffle +0 -0
- data/lib/sheets_db/resource.rb +5 -0
- data/lib/sheets_db/version.rb +1 -1
- data/lib/sheets_db/worksheet/row.rb +5 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2d95893f24d4f412a3b06e88a90a18332f2e933
|
4
|
+
data.tar.gz: c79d78003dc7a6060c5c99c76b8654fb0aa1dda4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 741ac59a7b501a8aaeeaedc19c0c3e0f318a6ff5aebf49a639a3b87b4e7ddf07967ab4b19d9be0a2b0c5f3c23771be507da6ac6a4255ce216fb12f97af6fa759
|
7
|
+
data.tar.gz: 3b190abe406276197261802e98f0b6b701e157a95ed1d5da0abae5df98e2a9224d64aaa9f31111a2b1fa6baeed25c581b161595cd30a4af664a264b94ef2a0b2
|
Binary file
|
data/lib/sheets_db/resource.rb
CHANGED
data/lib/sheets_db/version.rb
CHANGED
@@ -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.
|
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-
|
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
|