impress/app/models/donation_feature.rb

11 lines
241 B
Ruby
Raw Normal View History

2014-09-09 21:16:02 -07:00
class DonationFeature < ActiveRecord::Base
belongs_to :donation
belongs_to :outfit
validates :outfit, presence: true, if: :outfit_id?
def outfit_url=(outfit_url)
self.outfit_id = outfit_url.split('/').last rescue nil
end
end