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
428 B
13 lines
428 B
class DocumentAdvancedSearchComponent < BaseComponent |
|
attr_reader :opts |
|
|
|
def initialize(current_user:, opts: {}) |
|
@opts = opts |
|
end |
|
|
|
def years |
|
start_year = Cdao::Jurisprudence.order(year: :asc).first(10).map(&:year).compact.uniq.first || "1900" |
|
end_year = Cdao::Jurisprudence.order(year: :asc).last(10).map(&:year).compact.uniq.last || Time.zone.today.year |
|
(start_year..end_year).entries.reverse |
|
end |
|
end
|
|
|