bug suppression image galerie
This commit is contained in:
parent
32c39322ae
commit
937f0389f4
@ -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?
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user