diff --git a/app/models/supporter_level.rb b/app/models/supporter_level.rb index c8890e8e..ab1da49f 100644 --- a/app/models/supporter_level.rb +++ b/app/models/supporter_level.rb @@ -2,10 +2,12 @@ class SupporterLevel < ActiveRecord::Base belongs_to :conference has_many :supporter_registrations 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 + private - def convert_money_to_cents - self.price_cents = (self.amount.to_d * 100).to_i - end + + def convert_money_to_cents + self.price_cents = (self.amount.to_d * 100).to_i + end end diff --git a/db/migrate/20140522162159_add_registration_description_to_conference.rb b/db/migrate/20140522162159_add_registration_description_to_conference.rb index a24c99ec..b893de72 100644 --- a/db/migrate/20140522162159_add_registration_description_to_conference.rb +++ b/db/migrate/20140522162159_add_registration_description_to_conference.rb @@ -1,5 +1,5 @@ class AddRegistrationDescriptionToConference < ActiveRecord::Migration def change - add_column :conferences, :registration_description, :text + add_column :conferences, :registration_description, :text end end