1resu 2021-12-19 00:16:19 +01:00
parent f5efc9af77
commit 97444ab902
5 changed files with 7 additions and 4 deletions

View file

@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

View file

@ -22,7 +22,7 @@
# category :string(255)
#
class Article < ActiveRecord::Base
class Article < ApplicationRecord
belongs_to :supplier
validates_numericality_of :price, :tax, :deposit, :unit_quantity

View file

@ -1,4 +1,4 @@
class Supplier < ActiveRecord::Base
class Supplier < ApplicationRecord
has_many :articles, :dependent => :destroy
has_many :user_accesses, :dependent => :destroy
has_many :users, :through => :user_accesses

View file

@ -1,4 +1,4 @@
class User < ActiveRecord::Base
class User < ApplicationRecord
has_many :user_accesses, :dependent => :destroy
has_many :suppliers, :through => :user_accesses

View file

@ -1,4 +1,4 @@
class UserAccess < ActiveRecord::Base
class UserAccess < ApplicationRecord
belongs_to :user
belongs_to :supplier
end