bug suppression image galerie

This commit is contained in:
Nicolas Bally 2011-12-04 21:07:13 +01:00
parent 32c39322ae
commit 937f0389f4
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# -*- encoding : utf-8 -*- # -*- encoding : utf-8 -*-
class ImageFile < ActiveRecord::Base class ImageFile < ActiveRecord::Base
mount_uploader :file, ImageUploader mount_uploader :file, ImageUploader
has_many :gallery_images, :dependent => :destroy
before_save do before_save do
if !self.name? if !self.name?

View File

@ -1,6 +1,6 @@
# -*- encoding : utf-8 -*- # -*- encoding : utf-8 -*-
class GalleryImage < ActiveRecord::Base class GalleryImage < ActiveRecord::Base
belongs_to :image_file, :dependent => :destroy belongs_to :image_file
belongs_to :gallery belongs_to :gallery
validates :title, :presence => true validates :title, :presence => true