From f14f462eaf8dcf272db54cd513bf7ffe7dc6a6e3 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Mar 2016 18:26:47 +0100 Subject: Adding Turbolinks, adding status posting form on homepage --- app/models/status.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models') diff --git a/app/models/status.rb b/app/models/status.rb index 2fdd8d123..58d25546c 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -13,6 +13,7 @@ class Status < ActiveRecord::Base validates :account, presence: true validates :uri, uniqueness: true, unless: 'local?' + validates :text, presence: true, if: Proc.new { |s| s.local? && !s.reblog? } scope :with_counters, -> { select('statuses.*, (select count(r.id) from statuses as r where r.reblog_of_id = statuses.id) as reblogs_count, (select count(f.id) from favourites as f where f.status_id = statuses.id) as favourites_count') } scope :with_includes, -> { includes(:account, reblog: :account, thread: :account) } -- cgit