notion_ruby_mapping 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30bf2ddaea8b93f043bee15eebc6ac4cd20af0717365ca6f1b51bbd2267f8484
4
- data.tar.gz: 6a8914b322cbce8d5c86ee911cacb5980da56f1236856e7226a7b88b059674f2
3
+ metadata.gz: 5456cec1bec59a457b4ec8341226f9d01afb2bba707d525c8c23745eb1c5ce96
4
+ data.tar.gz: 569eab15b3b42b871aa0873d66c07a869631d0d7d68be5c733726b571c92ca02
5
5
  SHA512:
6
- metadata.gz: 93a41accb8a2833fb6046cc01a283a93ac26aad3468334dafeafa95cce47d1ba87913d0f9b6b5180b3bc4b5674b51f506ffd5c84d7f34878fe828e464e654403
7
- data.tar.gz: 325ca25b2820ae361149094f368a956581c50e9621b524051136b121636befb667af9434a1cb2da03889737130b9f8926bb746bd3c68f9804f5de088e66fb934
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 TitleProperty, "Name"
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
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NotionRubyMapping
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  NOTION_VERSION = "2022-02-22"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion_ruby_mapping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroyuki KOBAYASHI