lib/restpack_serializer/serializable/paging.rb in restpack_serializer-0.4.6 vs lib/restpack_serializer/serializable/paging.rb in restpack_serializer-0.4.7

- old
+ new

@@ -19,11 +19,11 @@ } } if options.include_links result[:links] = self.links - Array(RestPack::Serializer::Factory.create(*options.includes)).each do |serializer| + Array(RestPack::Serializer::Factory.create(*options.include)).each do |serializer| result[:links].merge! serializer.class.links end end side_load_data = side_loads(page, options) @@ -40,11 +40,11 @@ def serialize_meta(page, options) meta = { page: options.page, page_size: options.page_size, count: page.total_entries, - includes: options.includes + include: options.include } meta[:page_count] = ((page.total_entries - 1) / options.page_size) + 1 meta[:previous_page] = meta[:page] > 1 ? meta[:page] - 1 : nil meta[:next_page] = meta[:page] < meta[:page_count] ? meta[:page] + 1 : nil @@ -60,10 +60,10 @@ url = "#{RestPack::Serializer.config.href_prefix}/#{self.key}.json" params = [] params << "page=#{page}" unless page == 1 params << "page_size=#{options.page_size}" unless options.default_page_size? - params << "includes=#{options.includes.join(',')}" if options.includes.any? + params << "include=#{options.include.join(',')}" if options.include.any? params << options.filters_as_url_params if options.filters.any? url += '?' + params.join('&') if params.any? url end