add image cropping support
This commit is contained in:
@@ -173,6 +173,10 @@ class Post < ApplicationRecord
|
||||
storage_manager.file_path(md5, file_ext, :preview)
|
||||
end
|
||||
|
||||
def crop_file_url
|
||||
storage_manager.file_url(self, :crop)
|
||||
end
|
||||
|
||||
def open_graph_image_url
|
||||
if is_image?
|
||||
if has_large?
|
||||
|
||||
@@ -92,6 +92,8 @@ class User < ApplicationRecord
|
||||
has_many :post_approvals, :dependent => :destroy
|
||||
has_many :post_disapprovals, :dependent => :destroy
|
||||
has_many :post_votes
|
||||
has_many :post_archives
|
||||
has_many :note_versions
|
||||
has_many :bans, -> {order("bans.id desc")}
|
||||
has_one :recent_ban, -> {order("bans.id desc")}, :class_name => "Ban"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user