Permalink
Browse files

Changed Photo inheritance. Fixes #231.

  • Loading branch information...
jtessler committed May 2, 2012
1 parent 1e7f9eb commit 2078eedf120330bea5f20517e4743a9e4f1356c7
Showing with 6 additions and 3 deletions.
  1. +6 −3 app/models/Photo.java
View
@@ -13,27 +13,30 @@
import net.coobird.thumbnailator.name.*;
@Entity
-public class Photo extends Post {
+public class Photo extends Commentable {
public static final int MAX_PIXEL_SIZE = 1024;
@Required
public Blob image;
+ public String caption;
+
@Required
public Blob thumbnail120x120,
thumbnail50x50,
thumbnail30x30;
public Photo(User owner, File image) throws IOException,
FileNotFoundException {
- this(owner, image, "");
+ this(owner, image, null);
}
public Photo(User owner, File image, String caption)
throws IOException,
FileNotFoundException {
- super(owner, owner, caption);
+ super(owner);
+ this.caption = caption;
shrinkImage(image);
this.image = fileToBlob(image);
this.createThumbnails();

0 comments on commit 2078eed

Please sign in to comment.