From 595c8dda60746e171dbbb905b355561334e2a5c8 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 1 Sep 2016 13:21:48 +0200 Subject: Favouriting works, reblogging is a little broken because of --- app/models/account.rb | 2 +- app/models/favourite.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/account.rb b/app/models/account.rb index cc050dfa3..8b6300e35 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -75,7 +75,7 @@ class Account < ApplicationRecord end def ping!(atom_url, hubs) - return unless local? + return unless local? && !Rails.env.development? OStatus2::Publication.new(atom_url, hubs).publish end diff --git a/app/models/favourite.rb b/app/models/favourite.rb index 6032e539c..e248ae561 100644 --- a/app/models/favourite.rb +++ b/app/models/favourite.rb @@ -4,6 +4,8 @@ class Favourite < ApplicationRecord belongs_to :account, inverse_of: :favourites belongs_to :status, inverse_of: :favourites + validates :status_id, uniqueness: { scope: :account_id } + def verb :favorite end -- cgit