notion_ruby_mapping 0.3.1 → 0.3.2
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 +4 -4
- data/README.md +3 -2
- data/lib/notion_ruby_mapping/database.rb +1 -0
- data/lib/notion_ruby_mapping/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5456cec1bec59a457b4ec8341226f9d01afb2bba707d525c8c23745eb1c5ce96
|
|
4
|
+
data.tar.gz: 569eab15b3b42b871aa0873d66c07a869631d0d7d68be5c733726b571c92ca02
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57f9809f36aadb3f0b6af35f36cbe0b1b2e6c830b7b35273c30956e75b084e9bd51aeb2a819139f71a6f4adfd7c48a2edc021b56e3614924949c2c16f0b9bb98
|
|
7
|
+
data.tar.gz: b7869c6db0ad601d01c90cbecd32b7c54a9c85a4fda139a1b3b92bc8a2d7cec320d5efa58cd6f539ec06331f244be584d240821a8fc9e577f2e9bc904482924e
|
data/README.md
CHANGED
|
@@ -526,10 +526,10 @@ print db.query_database query, dry_run: true
|
|
|
526
526
|
|
|
527
527
|
#### 4.2.3 Create child page
|
|
528
528
|
|
|
529
|
-
`create_child_page` creates a child page object of the database. After setting some properties, please call `page.save` to send page information to Notion.
|
|
529
|
+
`create_child_page` creates a child page object of the database. After setting some properties, please call `page.save` to send page information to Notion. Properties of the created child page are automatically assigned using the parent database.
|
|
530
530
|
|
|
531
531
|
```Ruby
|
|
532
|
-
page = db.create_child_page
|
|
532
|
+
page = db.create_child_page
|
|
533
533
|
page.properties["Name"] << "New Page"
|
|
534
534
|
page.save
|
|
535
535
|
```
|
|
@@ -1268,6 +1268,7 @@ textMentionObjects = RichTextArray.new "title", [TextObject.new("A TextObject"),
|
|
|
1268
1268
|
|
|
1269
1269
|
## 6. ChangeLog
|
|
1270
1270
|
|
|
1271
|
+
- 2022/3/27 properties of a created child page are automatically assigned using the parent database.
|
|
1271
1272
|
- 2022/3/25 added create_child_database, update_database, add_property, rename_property and remove_property
|
|
1272
1273
|
- 2022/3/17 added template_mention objects, tools/an command
|
|
1273
1274
|
- 2022/3/16 added database.create_child_page and base.save instead of base.update/create
|
|
@@ -30,6 +30,7 @@ module NotionRubyMapping
|
|
|
30
30
|
# @param [Array<Property, Class, String>] assign
|
|
31
31
|
# @return [NotionRubyMapping::Base]
|
|
32
32
|
def create_child_page(*assign)
|
|
33
|
+
assign = properties.map { |p| [p.class, p.name ] }.flatten if assign.empty?
|
|
33
34
|
Page.new assign: assign, parent: {"database_id" => @id}
|
|
34
35
|
end
|
|
35
36
|
|