about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-21 18:26:47 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-21 18:26:47 +0100
commitf14f462eaf8dcf272db54cd513bf7ffe7dc6a6e3 (patch)
tree2275619996f64b55369e4f35cd228eb52dc48601 /app/models
parentc28971c70c3d5caf18a5e931ff345534f1e4cece (diff)
Adding Turbolinks, adding status posting form on homepage
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb1
1 files changed, 1 insertions, 0 deletions
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) }