* Additional effects
* Fixed flash pngs * Fixed dmail search links
This commit is contained in:
@@ -16,6 +16,7 @@ class Dmail < ActiveRecord::Base
|
||||
scope :active, where(["is_deleted = ?", false])
|
||||
scope :deleted, where(["is_deleted = ?", true])
|
||||
scope :search_message, lambda {|query| where(["message_index @@ plainto_tsquery(?)", query])}
|
||||
scope :unread, where("is_read = false and is_deleted = false")
|
||||
|
||||
module AddressMethods
|
||||
def to_name
|
||||
|
||||
@@ -136,7 +136,7 @@ class Post < ActiveRecord::Base
|
||||
def medium_file_url
|
||||
if has_medium?
|
||||
if is_flash?
|
||||
"/images/480x150-flash.png"
|
||||
"/images/480x200-flash.png"
|
||||
else
|
||||
"/data/medium/#{file_path_prefix}#{md5}.jpg"
|
||||
end
|
||||
@@ -235,7 +235,7 @@ class Post < ActiveRecord::Base
|
||||
|
||||
def medium_image_height
|
||||
if is_flash?
|
||||
return 204
|
||||
return 200
|
||||
end
|
||||
|
||||
ratio = Danbooru.config.medium_image_width.to_f / image_width.to_f
|
||||
|
||||
@@ -37,6 +37,7 @@ class User < ActiveRecord::Base
|
||||
has_one :ban
|
||||
has_many :subscriptions, :class_name => "TagSubscription", :foreign_key => "creator_id"
|
||||
has_many :note_versions, :foreign_key => "updater_id"
|
||||
has_many :dmails, :foreign_key => "owner_id", :order => "dmails.id desc"
|
||||
belongs_to :inviter, :class_name => "User"
|
||||
scope :named, lambda {|name| where(["lower(name) = ?", name])}
|
||||
scope :admins, where("is_admin = TRUE")
|
||||
|
||||
Reference in New Issue
Block a user