console.rb in object_attorney-2.10.9 vs console.rb in object_attorney-2.10.10
- old
+ new
@@ -12,6 +12,25 @@
p = PostWithCommentsAndAddressForm.new(address_attributes: address_attributes)
a = AddressForm.new(post_attributes: { title: 'asd', body: 'body' })
+
+params = {
+ post: {
+ title: 'First post',
+ body: 'post body',
+ comments_attributes: {
+ "0" => { body: "body1" },
+ "1" => { body: "body2" }
+ }
+ }
+}
+
+post_form = PostForm::Base.new(params[:post])
+post_form.save
+
+
+post_form = PostForm::Base.new(comments_attributes: { '1' => { id: 1, body: '1', _destroy: true } })
+
+
binding.pry