You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

13 lines
396 B

class DocumentAdvancedSearchComponent < BaseComponent
attr_reader :opts
def initialize(current_user:, opts: {})
@opts = opts
end
def years
start_year = Cdao::Jurisprudence.order(year: :desc).first(10).compact.map(&:year).uniq.first
end_year = Cdao::Jurisprudence.order(year: :asc).last(10).compact.map(&:year).uniq.first
(start_year..end_year).entries.reverse
end
end