Unknown attribute when monetizing a field using money-rails <p>I have the following class and I want to <code>monetize</code> a couple of its fields using the <code>money-rails</code> gem.</p> <pre><code>class LineItem &lt; ActiveRecord::Base monetize :unit_price_cents monetize :total_cents end </code></pre> <p>This is how the schema looks: </p> <pre><code>create_table "line_items", force: :cascade do |t| t.integer "invoice_id" t.float "quantity" t.string "unit_type" t.string "description" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "unit_price_cents", null: false t.integer "total_cents", null: false end </code></pre> <p>For some reason I get <code>undefined method 'unit_price' for #&lt;LineItem:0x007ffb7881eb80&gt;</code> unless I add aliasing to the monetized fields:</p> <pre><code>monetize :unit_price_cents, as: :unit_price </code></pre>