using rails::api.rails4? method
using Rails::VERSION::MAJOR == 4