Permalink
Browse files

Correct Rails/ApplicationRecord offense

  • Loading branch information...
mvz committed Sep 23, 2017
1 parent 67834f9 commit 4e16d601b860d257c86b719f7c703bc23833eb54
@@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
@@ -5,7 +5,7 @@
# Once upon a time, there were plans to make publify handle multiple blogs,
# but it never happened and publify is now firmly single-blog.
#
class Blog < ActiveRecord::Base
class Blog < ApplicationRecord
include ConfigManager
include Rails.application.routes.url_helpers
@@ -1,7 +1,7 @@
require 'set'
require 'uri'
class Content < ActiveRecord::Base
class Content < ApplicationRecord
include ContentBase
belongs_to :text_filter, optional: true
@@ -3,7 +3,7 @@
require 'aasm'
require 'akismet'
class Feedback < ActiveRecord::Base
class Feedback < ApplicationRecord
self.table_name = 'feedback'
belongs_to :text_filter, optional: true
@@ -1,3 +1,3 @@
class Ping < ActiveRecord::Base
class Ping < ApplicationRecord
belongs_to :article
end
@@ -1,4 +1,4 @@
class PostType < ActiveRecord::Base
class PostType < ApplicationRecord
validates :name, uniqueness: true
validates :name, presence: true
validate :name_is_not_read
@@ -1,4 +1,4 @@
class Redirect < ActiveRecord::Base
class Redirect < ApplicationRecord
belongs_to :contents, optional: true, touch: true
belongs_to :blog
@@ -1,4 +1,4 @@
class Redirection < ActiveRecord::Base
class Redirection < ApplicationRecord
belongs_to :content
belongs_to :redirect
end
@@ -1,7 +1,7 @@
require 'carrierwave'
require 'carrierwave/orm/activerecord'
class Resource < ActiveRecord::Base
class Resource < ApplicationRecord
belongs_to :blog
belongs_to :content, optional: true
@@ -1,7 +1,7 @@
require 'sidebar_field'
# This class cannot be autoloaded since other sidebar classes depend on it.
class Sidebar < ActiveRecord::Base
class Sidebar < ApplicationRecord
serialize :config, Hash
belongs_to :blog
@@ -1,4 +1,4 @@
class Tag < ActiveRecord::Base
class Tag < ApplicationRecord
belongs_to :blog
has_and_belongs_to_many :contents, order: 'created_at DESC'
@@ -1,6 +1,6 @@
require 'net/http'
class TextFilter < ActiveRecord::Base
class TextFilter < ApplicationRecord
serialize :filters, Array
serialize :params, Hash
@@ -1,4 +1,4 @@
class Trigger < ActiveRecord::Base
class Trigger < ApplicationRecord
belongs_to :pending_item, polymorphic: true
class << self
@@ -2,7 +2,7 @@
# Publify user.
# TODO: Should belong to a blog
class User < ActiveRecord::Base
class User < ApplicationRecord
ADMIN = 'admin'.freeze
PUBLISHER = 'publisher'.freeze
CONTRIBUTOR = 'contributor'.freeze

0 comments on commit 4e16d60

Please sign in to comment.