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

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -