remove unused absence_of_content check
this didn't do anything
This commit is contained in:
parent
2cd831f94e
commit
d72727f4ac
1 changed files with 8 additions and 21 deletions
|
|
@ -20,11 +20,6 @@ class StatusMessage < Post
|
|||
has_one :location
|
||||
has_one :poll, autosave: true
|
||||
|
||||
|
||||
# a StatusMessage is federated before its photos are so presence_of_content() fails erroneously if no text is present
|
||||
# therefore, we put the validation in a before_destory callback instead of a validation
|
||||
before_destroy :absence_of_content
|
||||
|
||||
attr_accessor :oembed_url
|
||||
attr_accessor :open_graph_url
|
||||
|
||||
|
|
@ -42,13 +37,15 @@ class StatusMessage < Post
|
|||
end
|
||||
|
||||
def self.user_tag_stream(user, tag_ids)
|
||||
owned_or_visible_by_user(user).
|
||||
tag_stream(tag_ids)
|
||||
owned_or_visible_by_user(user).tag_stream(tag_ids)
|
||||
end
|
||||
|
||||
def self.public_tag_stream(tag_ids)
|
||||
all_public.
|
||||
tag_stream(tag_ids)
|
||||
all_public.tag_stream(tag_ids)
|
||||
end
|
||||
|
||||
def self.tag_stream(tag_ids)
|
||||
joins(:taggings).where("taggings.tag_id IN (?)", tag_ids)
|
||||
end
|
||||
|
||||
def nsfw
|
||||
|
|
@ -124,20 +121,10 @@ class StatusMessage < Post
|
|||
}
|
||||
end
|
||||
|
||||
protected
|
||||
private
|
||||
|
||||
def presence_of_content
|
||||
errors[:base] << "Cannot create a StatusMessage without content" if text_and_photos_blank?
|
||||
end
|
||||
|
||||
def absence_of_content
|
||||
unless text_and_photos_blank?
|
||||
errors[:base] << "Cannot destory a StatusMessage with text and/or photos present"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def self.tag_stream(tag_ids)
|
||||
joins(:taggings).where('taggings.tag_id IN (?)', tag_ids)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue