Files
grecia/app/models/application_record.rb
Javi Martín d18c627392 Add and apply Layout/EmptyLinesAfterModuleInclusion rule
This rule was added in rubocop 1.79. We were inconsistent about it, so
we're adding it to get more consistency.
2025-11-05 14:27:12 +01:00

15 lines
286 B
Ruby

class ApplicationRecord < ActiveRecord::Base
include HumanName
include SkipValidation
self.abstract_class = true
def self.sample(count = 1)
if count == 1
reorder(Arel.sql("RANDOM()")).first
else
reorder(Arel.sql("RANDOM()")).limit(count)
end
end
end