lib/jsonapi-serializers/attributes.rb in jsonapi-serializers-0.10.0 vs lib/jsonapi-serializers/attributes.rb in jsonapi-serializers-0.11.0
- old
+ new
@@ -50,18 +50,22 @@
}
end
private :add_attribute
def add_to_one_association(name, options = {}, &block)
+ options[:include_links] = options.fetch(:include_links, true)
+ options[:include_data] = options.fetch(:include_data, false)
@to_one_associations ||= {}
@to_one_associations[name] = {
attr_or_block: block_given? ? block : name,
options: options,
}
end
private :add_to_one_association
def add_to_many_association(name, options = {}, &block)
+ options[:include_links] = options.fetch(:include_links, true)
+ options[:include_data] = options.fetch(:include_data, false)
@to_many_associations ||= {}
@to_many_associations[name] = {
attr_or_block: block_given? ? block : name,
options: options,
}