def update_resource(opts = {})
      resource_class.properties.each do |field_name, property|
        values = update_from_field(field_name) if fields[field_name]
        # TODO: add/fix tests for this behaviour when true
        values = update_from_relation(field_name, opts[:related] || Ladder::Config.settings[:with_relations]) if relations[field_name]

        resource.set_value(property.predicate, values)
      end

      resource
    end
def update_resource(opts = {})
      resource_class.properties.each do |field_name, property|
        values = update_from_field(field_name) if fields[field_name]
        # TODO: add/fix tests for this behaviour when true
        values = update_from_relation(field_name, opts[:related] || Ladder::Config.settings[:with_relations]) if relations[field_name]

        resource.set_value(property.predicate, values)
      end

      resource
    end
Update the delegated ActiveTriples::Resource from
 ActiveModel properties & relations

 @param [Hash] opts options to pass to Mongoid / ActiveTriples
 @option opts [Boolean] :related whether to include related resources
 @return [ActiveTriples::Resource] resource for the object