Upgrade to Rails 5.0.0.1
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
class Account < ActiveRecord::Base
|
||||
class Account < ApplicationRecord
|
||||
include Targetable
|
||||
|
||||
# Local users
|
||||
has_one :user, inverse_of: :account
|
||||
validates :username, uniqueness: { scope: :domain, case_sensitive: false }, if: 'local?'
|
||||
validates :username, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?'
|
||||
validates :username, presence: true, uniqueness: { scope: :domain, case_sensitive: false }, if: 'local?'
|
||||
validates :username, presence: true, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?'
|
||||
|
||||
# Avatar upload
|
||||
has_attached_file :avatar, styles: { large: '300x300#', medium: '96x96#', small: '48x48#' }, default_url: 'avatars/missing.png'
|
||||
|
3
app/models/application_record.rb
Normal file
3
app/models/application_record.rb
Normal file
@ -0,0 +1,3 @@
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
class Favourite < ActiveRecord::Base
|
||||
class Favourite < ApplicationRecord
|
||||
include Streamable
|
||||
|
||||
belongs_to :account, inverse_of: :favourites
|
||||
|
@ -1,4 +1,4 @@
|
||||
class Follow < ActiveRecord::Base
|
||||
class Follow < ApplicationRecord
|
||||
include Streamable
|
||||
|
||||
belongs_to :account
|
||||
|
@ -1,4 +1,4 @@
|
||||
class Mention < ActiveRecord::Base
|
||||
class Mention < ApplicationRecord
|
||||
belongs_to :account, inverse_of: :mentions
|
||||
belongs_to :status
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
class Status < ActiveRecord::Base
|
||||
class Status < ApplicationRecord
|
||||
include Paginable
|
||||
include Streamable
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
class StreamEntry < ActiveRecord::Base
|
||||
class StreamEntry < ApplicationRecord
|
||||
include Paginable
|
||||
|
||||
belongs_to :account, inverse_of: :stream_entries
|
||||
|
@ -1,4 +1,4 @@
|
||||
class User < ActiveRecord::Base
|
||||
class User < ApplicationRecord
|
||||
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
belongs_to :account, inverse_of: :user
|
||||
|
Reference in New Issue
Block a user