title: How to make attribute setter send value through SQL function
body: <p>I'm trying to make an attribute setter in an ActiveRecord model wrap its value in the text2ltree() postgres function before rails generates its sql query. </p>
  
  <p>For example,</p>
  
  <pre><code>post.path = "1.2.3"
  post.save
  </code></pre>
  
  <p>Should generate something like</p>
  
  <pre><code>UPDATE posts SET PATH=text2ltree('1.2.3') WHERE id = 123 # or whatever
  </code></pre>
  
  <p>What's the best way of doing this?</p>