rooftopcms / rooftop-ruby

A client library for getting your content out of Rooftop CMS with Ruby.
https://www.rooftopcms.com
GNU General Public License v3.0
2 stars 2 forks source link

.find() doesn't correctly build a ResourceLinks::Collection #9

Open edtjones opened 8 years ago

edtjones commented 8 years ago

For some reason this works:

Page.find_by(slug: 'sample-page').first.resource_links.collect(&:link_type)
# => ["self", "collection", "about", "author", "replies", "version-history", "https://api.w.org/attachment", "https://api.w.org/meta", "http://docs.rooftopcms.com/link_relations/children"] 

But this doesn't:

Page.find(2).resource_links.collect(&:link_type)
# => [nil, nil, nil, nil, nil, nil, nil, nil, nil]

In reality we'll spend most of the time doing the former, but the latter should definitely work.