title: Is it ok to make http calls from a Rails Model?
body: <p>I'm working in an integration between my system and an external webservice. In my system, I have a <code>Customer</code> model. A customer, can be in debit, but this information (the customer's financial situation) isn't available in my database. It is in the webservice that I'm integrating with.</p>
  
  <p>I created a method in this model and named it as <code>is_in_debit?</code>. In the method implementation, I'm making a HTTP call to the Webservice.</p>
  
  <pre><code>class Customer &lt; ActiveRecord::Base
    ...
  
    def is_in_debit?
      response = HTTP.get_response('https://...').body
      response = JSON.parse(response)
  
      response['status'] == 'active' ? false : true
    end
  end
  </code></pre>
  
  <p>But I'm in doubt if the model is the right place to make a HTTP call. From the view point of architecture, is it right? Or should I change my approach?</p>