* Removing the root on decoding was added to ActiveResource 3.1, so only needs to be patched for 3.0. * The encode patch isn't needed for ActiveModel 3.2, since ActiveResource passes :root to as_json, and in 3.2 :root is used even when include_root_in_json is false. * The as_json patch was compensating for the encode patch for ActiveModel 3.2, so this patch isn't necessary by avoiding patching encode for this version. * The encode patch is ShopifyAPI::Base specific, since we set include_root_in_json to false and add the root manually. We should avoid side-effects for other APIs.
Root encode fix now properly limited to ShopifyAPI Base classes only instead of overwriting Rails module functionality for any project that includes this gem. Our previous soluction was ignoring the system-wide include_root_in_json setting that wasn't explicitly set in the to_json options.