Permalink
Browse files

small fix

  • Loading branch information...
pedromtavares committed Dec 6, 2011
1 parent b195ee6 commit 2c3a3ff412ecc71b78e91b0cf9bcc3ffa58477dd
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/group.rb
View
@@ -22,7 +22,7 @@ class Group < ActiveRecord::Base
validates :name, :presence => true, :uniqueness => true, :length => { :minimum => 4, :maximum => 100 }, :exclusion => {:in => Rails.application.routes.routes.map{|r| r.path.split('/').second}.compact.uniq}
validates :description, :length => {:maximum => 1000}
- validates :image, :length => {:maximum => MAXIMUM_IMAGE_SIZE, :message => I18n.t('custom_messages.image_validation', :size => MAXIMUM_IMAGE_SIZE_MB)}
+ validates :image, :length => {:maximum => MAXIMUM_IMAGE_SIZE, :message => I18n.t('custom_messages.image_validation', :size => MAXIMUM_IMAGE_SIZE_MB)}, :if => lambda { self.image.present? }
scope :recent, order('created_at desc').limit(5)

0 comments on commit 2c3a3ff

Please sign in to comment.