lib/daylight/api.rb
##
# Override `ActiveResource` method so it strips the meta attributes for create and update actions.
#
# Solves problem where `remove_root` was not performing because meta was still in the response.
# For GET objects, this is handled by `initialize` but that's too late in this case.
#
# See:
# ActiveResource::Base#load_attributes_from_response
Override `ActiveResource` method so it strips the meta attributes for create and update actions.
Solves problem where `remove_root` was not performing because meta was still in the response.
For GET objects, this is handled by `initialize` but that's too late in this case.


Override ` ActiveResource ` method so it strips the meta attributes for create and update actions . Solves problem where ` remove_root ` was not performing because meta was still in the response . For GET objects this is handled by ` initialize ` but that ' s too late in this case .
def load_attributes_from_response(response)
      if response_loadable?(response)
        decoded_body = self.class.format.decode(response.body)
        extract_metadata!(decoded_body)
        load(decoded_body, true, true)
        @persisted = true
      end
    end
def load_attributes_from_response ( response ) if response_loadable? ( response ) decoded_body = self . class . format . decode ( response . body ) extract_metadata! ( decoded_body ) load ( decoded_body , true , true ) @persisted = true end end
Override `ActiveResource` method so it strips the meta attributes for create and update actions.
Override ` ActiveResource ` method so it strips the meta attributes for create and update actions .
response
<not_specific>