about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-15 13:23:47 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-15 13:23:47 +0100
commitab165547fdf556b10b80898c030d54e20bff50af (patch)
treec9478742222e0f73fe4049edbc6840d3020eb235 /app/models
parent1f7c0ad8d3d336b036d16272716e41812f65f5d9 (diff)
parentf81dc7a33ae975b640089e474b01c2081119f372 (diff)
Merge branch 'feature/toot-app-source' of https://github.com/ineffyble/mastodon into ineffyble-feature/toot-app-source
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/application.rb8
-rw-r--r--app/models/status.rb2
2 files changed, 10 insertions, 0 deletions
diff --git a/app/models/concerns/application.rb b/app/models/concerns/application.rb
new file mode 100644
index 000000000..613be34ee
--- /dev/null
+++ b/app/models/concerns/application.rb
@@ -0,0 +1,8 @@
+module ApplicationExtension
+  extend ActiveSupport::Concern
+  included do
+    validates :website
+  end
+end
+
+Doorkeeper::Application.send :include, ApplicationExtension
\ No newline at end of file
diff --git a/app/models/status.rb b/app/models/status.rb
index bc595c93b..8301ae16e 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -7,6 +7,8 @@ class Status < ApplicationRecord
 
   enum visibility: [:public, :unlisted, :private], _suffix: :visibility
 
+  belongs_to :application, class_name: 'Doorkeeper::Application'
+
   belongs_to :account, inverse_of: :statuses
   belongs_to :in_reply_to_account, foreign_key: 'in_reply_to_account_id', class_name: 'Account'