Currently I have the above mentioned issue.
From my understanding, this is an on going issue with rails autoloading and how there are standards in namespacing the various class.
Product which retrieve product/products without any scope.
# product.rb
class Product < ActiveResource::Base
self.site = "#{end_point}/api/v2"
....
end
Market::Product which provide us an interface to seek product under the market scope, which is similar to a product.
# market/product.rb
class Market
class Product < ::Product
self.site = "#{end_point}/api/v2/markets/:market_name"
....
end
end
Controller could call the market product object, but the object being return is just product
# market_product_controller.rb
class MarketProductController < ApplicationController
def index
@object = ::Market::Product.all
end
....
end
On api, they are 2 different end-point, with 2 different result sets.
So far, when calling ::Market::Product, it seems like it is using ::Product url and :market_name as a params to that url.
Is there a good solution to this?
How did the rest of the community get around this issue?
Cheers for any help that is given.