title: Rails - regexp validation for number of decimal points
body: <p>I have a model that validates a decimal precision by regular expression:</p>
  
  <pre><code>    class Loan &lt; ActiveRecord::Base
        validates :amount,
                  format: {with: /\A\d+(?:\.\d{0,2})?\z/}, numericality: {less_than: 1000000}, allow_blank: true
      end
  </code></pre>
  
  <p>In Rails <strong>4.2.4</strong></p>
  
  <pre><code>l = Loan.new
  l.amount = 1.1111
  l.valid? # false
  </code></pre>
  
  <p>In Rails <strong>4.2.5</strong></p>
  
  <pre><code>l = Loan.new
  l.amount = 1.1111
  l.valid? # true
  </code></pre>
  
  <p>I there a problem in my regular expression that is exposed by newer version or Rails, Rails validation itself or perhaps something else?</p>