about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-02-28 21:22:56 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-02-28 21:22:56 +0100
commit11ff92c9d7b27c2c9ed86f649aef8d956cc8b989 (patch)
treea6294bad9352e6f2e181388a33a4b45dcda53319 /app/models
parent47d50b0e3967f1d396bdbe8ea3e8909ce2be599f (diff)
Adding a test for ReblogService, fixing mentions for remote statuses
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb3
-rw-r--r--app/models/mention.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index e9fc03a10..6cb638b3e 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -11,6 +11,7 @@ class Account < ActiveRecord::Base
   has_many :stream_entries, inverse_of: :account
   has_many :statuses, inverse_of: :account
   has_many :favourites, inverse_of: :account
+  has_many :mentions, inverse_of: :account
 
   # Follow relations
   has_many :active_relationships,  class_name: 'Follow', foreign_key: 'account_id',        dependent: :destroy
@@ -77,7 +78,7 @@ class Account < ActiveRecord::Base
 
   before_create do
     if local?
-      keypair = OpenSSL::PKey::RSA.new(Rails.env.test? ? 48 : 2048)
+      keypair = OpenSSL::PKey::RSA.new(Rails.env.test? ? 1024 : 2048)
       self.private_key = keypair.to_pem
       self.public_key  = keypair.public_key.to_pem
     end
diff --git a/app/models/mention.rb b/app/models/mention.rb
index 52f40e4b2..9fefa657a 100644
--- a/app/models/mention.rb
+++ b/app/models/mention.rb
@@ -1,6 +1,6 @@
 class Mention < ActiveRecord::Base
   belongs_to :account, inverse_of: :mentions
-  belongs_to :status, inverse_of: :mentions
+  belongs_to :status
 
   validates :account, :status, presence: true
   validates :account, uniqueness: { scope: :status }