From e9e08564e7a95824ea2b883861a9055a409130cb Mon Sep 17 00:00:00 2001 From: Washington Botelho Date: Fri, 9 Feb 2018 16:53:00 -0200 Subject: [PATCH] up: using config to build ar relations --- lib/rating/models/rating/extension.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rating/models/rating/extension.rb b/lib/rating/models/rating/extension.rb index e4365ca..e44fb82 100644 --- a/lib/rating/models/rating/extension.rb +++ b/lib/rating/models/rating/extension.rb @@ -48,17 +48,17 @@ module Rating has_many :rating_records, as: :resource, - class_name: '::Rating::Rating', + class_name: ::Rating.config.rating_model, dependent: :destroy has_many :rates_records, as: :resource, - class_name: '::Rating::Rate', + class_name: ::Rating.config.rate_model, dependent: :destroy has_many :rated_records, as: :author, - class_name: '::Rating::Rate', + class_name: ::Rating.config.rate_model, dependent: :destroy scope :order_by_rating, ->(column = :estimate, direction = :desc, scope: nil) {