app/models/phcmemberspro/directory/category.rb in phcmemberspro-8.6.3 vs app/models/phcmemberspro/directory/category.rb in phcmemberspro-9.0.0
- old
+ new
@@ -1,18 +1,12 @@
module Phcmemberspro
- class Directory::Category < ActiveRecord::Base
+ class Directory::Category < ApplicationRecord
# Add Paper Trail
has_paper_trail
- # Model Relationship
- has_many :listings, class_name: 'Directory::Listing', dependent: :destroy
- has_many :businesses, class_name: 'Members::Business', :through => :listings
-
- # Validation for Form Fields
- validates :catname,
- presence: true,
- uniqueness: {scope: :oganization_id},
- length: { minimum: 3 }
+ # Model Relationships
+ has_many :categorylistings, class_name: 'Phcmemberspro::Directory::Categorylisting', dependent: :destroy
+ has_many :listings, class_name: 'Phcmemberspro::Member::Listing', :through => :categorylistings
end
end