We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 79974b5 + 6040a6c commit 14bb881Copy full SHA for 14bb881
app/models/asset_photo.rb
@@ -1,4 +1,5 @@
1
class AssetPhoto < ActiveRecord::Base
2
belongs_to :photoable, :polymorphic => true
3
belongs_to :photo
4
-end
+end
5
+
app/models/comment.rb
@@ -5,4 +5,11 @@ class Comment < ActiveRecord::Base
6
# NOTE: Comments belong to a profile
7
belongs_to :profile
8
9
+ def as_json(options={})
10
+ hash = super.as_json
11
+ # add profile to json
12
+ hash["profile"] = self.profile
13
+ return hash
14
+ end
15
end
0 commit comments