noosfero | folder: #empty? is emptying #children (probably a rails bug) (#637)

Rodrigo Souto gitlab at gitlab.com
Tue Jul 28 16:42:49 BRT 2015


New comment for Merge Request 637

https://gitlab.com/noosfero/noosfero/merge_requests/637#note_1714169


Rodrigo Souto

I couldn't reproduce it either.

```
irb(main):028:0> parent
=> #<Folder id: 399, name: "parent", slug: "parent", path: "parent", parent_id: nil, body: nil, abstract: nil, profile_id: 53, updated_at: "2015-07-28 19:34:28", created_at: "2015-07-28 19:31:21", last_changed_by_id: nil, version: 1, type: "Folder", size: nil, content_type: nil, filename: nil, height: nil, width: nil, comments_count: 0, advertise: true, published: true, start_date: nil, end_date: nil, children_count: 1, accept_comments: true, reference_article_id: nil, setting: {}, notify_comments: true, hits: 0, published_at: "2015-07-28 19:31:21", source: nil, highlighted: false, external_link: nil, thumbnails_processed: false, is_image: false, translation_of_id: nil, language: nil, source_name: nil, license_id: nil, image_id: nil, position: nil, spam_comments_count: 0, author_id: nil, created_by_id: nil, show_to_followers: true>
irb(main):029:0> subfolder
=> #<Folder id: 400, name: "subfolder", slug: "subfolder", path: "parent/subfolder", parent_id: 399, body: nil, abstract: nil, profile_id: 53, updated_at: "2015-07-28 19:34:28", created_at: "2015-07-28 19:32:07", last_changed_by_id: nil, version: 1, type: "Folder", size: nil, content_type: nil, filename: nil, height: nil, width: nil, comments_count: 0, advertise: true, published: true, start_date: nil, end_date: nil, children_count: 3, accept_comments: true, reference_article_id: nil, setting: {}, notify_comments: true, hits: 0, published_at: "2015-07-28 19:32:07", source: nil, highlighted: false, external_link: nil, thumbnails_processed: false, is_image: false, translation_of_id: nil, language: nil, source_name: nil, license_id: nil, image_id: nil, position: nil, spam_comments_count: 0, author_id: nil, created_by_id: nil, show_to_followers: true>
irb(main):030:0> subfolder.parent == parent
=> true
irb(main):031:0> subfolder.children
=> [#<TinyMceArticle id: 403, name: "bli3", slug: "bli3", path: "parent/subfolder/bli3", parent_id: 400, body: "", abstract: nil, profile_id: 53, updated_at: "2015-07-28 19:34:28", created_at: "2015-07-28 19:34:28", last_changed_by_id: nil, version: 1, type: "TinyMceArticle", size: nil, content_type: nil, filename: nil, height: nil, width: nil, comments_count: 0, advertise: true, published: true, start_date: nil, end_date: nil, children_count: 0, accept_comments: true, reference_article_id: nil, setting: {}, notify_comments: true, hits: 0, published_at: "2015-07-28 19:34:28", source: nil, highlighted: false, external_link: nil, thumbnails_processed: false, is_image: false, translation_of_id: nil, language: nil, source_name: nil, license_id: nil, image_id: nil, position: nil, spam_comments_count: 0, author_id: nil, created_by_id: nil, show_to_followers: true>, #<TinyMceArticle id: 402, name: "bli2", slug: "bli2", path: "parent/subfolder/bli2", parent_id: 400, body: "", abstract: nil, profile_id: 53, updated_at: "2015-07-28 19:34:21", created_at: "2015-07-28 19:34:21", last_changed_by_id: nil, version: 1, type: "TinyMceArticle", size: nil, content_type: nil, filename: nil, height: nil, width: nil, comments_count: 0, advertise: true, published: true, start_date: nil, end_date: nil, children_count: 0, accept_comments: true, reference_article_id: nil, setting: {}, notify_comments: true, hits: 0, published_at: "2015-07-28 19:34:21", source: nil, highlighted: false, external_link: nil, thumbnails_processed: false, is_image: false, translation_of_id: nil, language: nil, source_name: nil, license_id: nil, image_id: nil, position: nil, spam_comments_count: 0, author_id: nil, created_by_id: nil, show_to_followers: true>, #<TinyMceArticle id: 401, name: "bli1", slug: "bli1", path: "parent/subfolder/bli1", parent_id: 400, body: "", abstract: nil, profile_id: 53, updated_at: "2015-07-28 19:34:13", created_at: "2015-07-28 19:34:13", last_changed_by_id: nil, version: 1, type: "TinyMceArticle", size: nil, content_type: nil, filename: nil, height: nil, width: nil, comments_count: 0, advertise: true, published: true, start_date: nil, end_date: nil, children_count: 0, accept_comments: true, reference_article_id: nil, setting: {}, notify_comments: true, hits: 0, published_at: "2015-07-28 19:34:13", source: nil, highlighted: false, external_link: nil, thumbnails_processed: false, is_image: false, translation_of_id: nil, language: nil, source_name: nil, license_id: nil, image_id: nil, position: nil, spam_comments_count: 0, author_id: nil, created_by_id: nil, show_to_followers: true>]
irb(main):032:0> subfolder.children.empty?
=> false
irb(main):033:0> subfolder.children       
=> [#<TinyMceArticle id: 403, name: "bli3", slug: "bli3", path: "parent/subfolder/bli3", parent_id: 400, body: "", abstract: nil, profile_id: 53, updated_at: "2015-07-28 19:34:28", created_at: "2015-07-28 19:34:28", last_changed_by_id: nil, version: 1, type: "TinyMceArticle", size: nil, content_type: nil, filename: nil, height: nil, width: nil, comments_count: 0, advertise: true, published: true, start_date: nil, end_date: nil, children_count: 0, accept_comments: true, reference_article_id: nil, setting: {}, notify_comments: true, hits: 0, published_at: "2015-07-28 19:34:28", source: nil, highlighted: false, external_link: nil, thumbnails_processed: false, is_image: false, translation_of_id: nil, language: nil, source_name: nil, license_id: nil, image_id: nil, position: nil, spam_comments_count: 0, author_id: nil, created_by_id: nil, show_to_followers: true>, #<TinyMceArticle id: 402, name: "bli2", slug: "bli2", path: "parent/subfolder/bli2", parent_id: 400, body: "", abstract: nil, profile_id: 53, updated_at: "2015-07-28 19:34:21", created_at: "2015-07-28 19:34:21", last_changed_by_id: nil, version: 1, type: "TinyMceArticle", size: nil, content_type: nil, filename: nil, height: nil, width: nil, comments_count: 0, advertise: true, published: true, start_date: nil, end_date: nil, children_count: 0, accept_comments: true, reference_article_id: nil, setting: {}, notify_comments: true, hits: 0, published_at: "2015-07-28 19:34:21", source: nil, highlighted: false, external_link: nil, thumbnails_processed: false, is_image: false, translation_of_id: nil, language: nil, source_name: nil, license_id: nil, image_id: nil, position: nil, spam_comments_count: 0, author_id: nil, created_by_id: nil, show_to_followers: true>, #<TinyMceArticle id: 401, name: "bli1", slug: "bli1", path: "parent/subfolder/bli1", parent_id: 400, body: "", abstract: nil, profile_id: 53, updated_at: "2015-07-28 19:34:13", created_at: "2015-07-28 19:34:13", last_changed_by_id: nil, version: 1, type: "TinyMceArticle", size: nil, content_type: nil, filename: nil, height: nil, width: nil, comments_count: 0, advertise: true, published: true, start_date: nil, end_date: nil, children_count: 0, accept_comments: true, reference_article_id: nil, setting: {}, notify_comments: true, hits: 0, published_at: "2015-07-28 19:34:13", source: nil, highlighted: false, external_link: nil, thumbnails_processed: false, is_image: false, translation_of_id: nil, language: nil, source_name: nil, license_id: nil, image_id: nil, position: nil, spam_comments_count: 0, author_id: nil, created_by_id: nil, show_to_followers: true>]
irb(main):034:0> 

```

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150728/c3ffe827/attachment.html>


More information about the Noosfero-dev mailing list