app/models/micropost.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