up: using config to build ar relations
parent
148f12f8f9
commit
e9e08564e7
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue