lib/rating/models/rating/rate.rb in rating-0.8.0 vs lib/rating/models/rating/rate.rb in rating-0.9.0
- old
+ new
@@ -14,10 +14,10 @@
validates :author, :resource, :value, presence: true
validates :value, numericality: { greater_than_or_equal_to: 1, less_than_or_equal_to: 100 }
validates :author_id, uniqueness: {
case_sensitive: ::Rating::Config.validations['rate']['case_sensitive'],
- scope: ::Rating::Config.validations['rate']['scope'].map(&:to_sym)
+ scope: ::Rating::Config.validations['rate']['scope'].map(&:to_sym),
}
def self.create(author:, extra_scopes:, metadata:, resource:, scopeable: nil, value:)
attributes = { author: author, resource: resource, scopeable: scopeable }.merge(extra_scopes)
record = find_or_initialize_by(attributes)