lib/bridgetown-prismic/api.rb in bridgetown-prismic-0.2.2 vs lib/bridgetown-prismic/api.rb in bridgetown-prismic-0.2.3
- old
+ new
@@ -18,9 +18,15 @@
model_for_prismic_type(link.type).prismic_url(full_doc)
else
"/"
end
end
+
+ Bridgetown::Model::Base.descendants.each do |klass|
+ next unless klass.respond_to?(:prismic_custom_type)
+
+ Bridgetown::Resource.register_extension klass
+ end
end
def query_prismic(custom_type, options = {})
Bridgetown.logger.info "Prismic API:", "Loading #{custom_type.to_s.green}..."