0

I have an active record model called Record (representing a physical vinyl record) and I'm trying to make use of money/rails which uses rubymoney/monetize

I've followed the instructions in money/rails which tells me to utilize a model class method "monetize :attribute_name_cents" and then address it with attribute_name, however when I run my application marketplace_price is nil. I have no clue what I'm doing wrong here. I'm certain the gem is loaded, and being used. I'm certain that it's providing a sans _cents method automagically yet it is nil and not a Money object as expected. What am I missing?

class Record < ActiveRecord::Base
   belongs_to :wantlist
   monetize :marketplace_price_cents, :allow_nil => true
end
  • Have you created a migration and added the `marketplace_price_cents` field to `Record` table? – makhan Feb 27 '15 at 08:36
  • Yes, however the table is named records and not Record? Is this the problem? I don't think it is the problem. – rabbitfeetz Mar 01 '15 at 08:13
  • heres what the schema.rb looks like for the records table http://imgur.com/W7wzNhb – rabbitfeetz Mar 01 '15 at 08:16
  • `schema.rb` looks good to me. Don't have other ideas at the moment. – makhan Mar 01 '15 at 14:27
  • Hey it's a bit old, but I ran into same problem, configuration all good (I use money-rails on many proects), but on this one not generating method... this is only project thou that uses active-admin gem.... are you using it also ? sry don;t have enought time to go thourgh to find out myself, just asking :) – Redrick Mar 19 '16 at 18:08

0 Answers0