app/models/product.rb
def picture_size
  		if picture.size > 5.megabytes
  			errors.add(:picture, "should be less than 5MB")
  		end
  	end
# Validates the size of an uploaded picture.
Validates the size of an uploaded picture.
Validates the size of an uploaded picture .
def picture_size
  		if picture.size > 5.megabytes
  			errors.add(:picture, "should be less than 5MB")
  		end
  	end
def picture_size if picture . size > 5 . megabytes errors . add ( :picture , "should be less than 5MB" ) end end
Validates the size of an uploaded picture.
Validates the size of an uploaded picture .