ruby on rails - Fake Class for Development Environment -
i have service runs on production machine access through service class in app.
because of licensing costs, i'd fake service test , development environments.
how can load different class definition depending on environment in rails app?
use rails.env in implementation
def my_method if rails.env.production? model.production_method else model.development_method end end
Comments
Post a Comment