title: Raisl 4 - attr_encrypted : How to decrypt values with select on encrypted values
body: <p>We are encrypting values in table / model - RegisteredDomain, using attr_encrypted below </p>
  
  <pre><code>attr_encrypted :domain_name, :registered_by, :api_key, :key =&gt; "65xU4TdZntTV53"
  </code></pre>
  
  <p>Values get encrypted and stored to db as well. Below code saves values to db.</p>
  
  <pre><code>registereddomain = RegisteredDomain.new(
          :domain_name =&gt; domain_name,
          :api_key =&gt;  api_key,
          :hash_key =&gt; hash_key,
          :registered_by =&gt; ep_id,
          :status =&gt;  status,
          :domain_type_id =&gt; domain_type_id              
          )
  registereddomain.save
  </code></pre>
  
  <p>Problem is with decrypting values with below select. We get encrypted values here, could anyone tell how to get decrytpted values in listing.</p>
  
  <pre><code>def select_all
    @registered_domains = RegisteredDomain.select("id, encrypted_domain_name, domain_type_id, encrypted_api_key, status").order(updated_at: :desc)
    return @registered_domains
  end
  </code></pre>