houndci fixes

This commit is contained in:
Gopesh Tulsyan 2014-05-23 21:38:40 +05:30
parent 5c9e0a279e
commit 3e349911c3
2 changed files with 7 additions and 5 deletions

View file

@ -2,9 +2,11 @@ class SupporterLevel < ActiveRecord::Base
belongs_to :conference belongs_to :conference
has_many :supporter_registrations has_many :supporter_registrations
monetize :price_cents, with_model_currency: :price_currency monetize :price_cents, with_model_currency: :price_currency
attr_accessible :conference, :title, :url, :description, :price_currency, :amount attr_accessible :conference, :title, :url, :description, :price_currency, :amount, :price_cents
validate :convert_money_to_cents validate :convert_money_to_cents
private private
def convert_money_to_cents def convert_money_to_cents
self.price_cents = (self.amount.to_d * 100).to_i self.price_cents = (self.amount.to_d * 100).to_i
end end