Browse Source

Make all models inherit from Blazer::Record

Andrew Kane 7 years ago
parent
commit
0ccc4ed4d7

+ 1 - 1
app/models/blazer/audit.rb

@@ -1,5 +1,5 @@
 module Blazer
-  class Audit < ActiveRecord::Base
+  class Audit < Record
     belongs_to :user, Blazer::BELONGS_TO_OPTIONAL.merge(class_name: Blazer.user_class.to_s)
     belongs_to :query, Blazer::BELONGS_TO_OPTIONAL
   end

+ 1 - 1
app/models/blazer/check.rb

@@ -1,5 +1,5 @@
 module Blazer
-  class Check < ActiveRecord::Base
+  class Check < Record
     belongs_to :creator, Blazer::BELONGS_TO_OPTIONAL.merge(class_name: Blazer.user_class.to_s) if Blazer.user_class
     belongs_to :query
 

+ 1 - 1
app/models/blazer/dashboard.rb

@@ -1,5 +1,5 @@
 module Blazer
-  class Dashboard < ActiveRecord::Base
+  class Dashboard < Record
     belongs_to :creator, Blazer::BELONGS_TO_OPTIONAL.merge(class_name: Blazer.user_class.to_s) if Blazer.user_class
     has_many :dashboard_queries, dependent: :destroy
     has_many :queries, through: :dashboard_queries

+ 1 - 1
app/models/blazer/dashboard_query.rb

@@ -1,5 +1,5 @@
 module Blazer
-  class DashboardQuery < ActiveRecord::Base
+  class DashboardQuery < Record
     belongs_to :dashboard
     belongs_to :query
 

+ 1 - 1
app/models/blazer/query.rb

@@ -1,5 +1,5 @@
 module Blazer
-  class Query < ActiveRecord::Base
+  class Query < Record
     belongs_to :creator, Blazer::BELONGS_TO_OPTIONAL.merge(class_name: Blazer.user_class.to_s) if Blazer.user_class
     has_many :checks, dependent: :destroy
     has_many :dashboard_queries, dependent: :destroy

+ 5 - 0
app/models/blazer/record.rb

@@ -0,0 +1,5 @@
+module Blazer
+  class Record < ActiveRecord::Base
+    self.abstract_class = true
+  end
+end