diff --git a/app/models/paper.rb b/app/models/paper.rb index c2240ed..1b5fd91 100644 --- a/app/models/paper.rb +++ b/app/models/paper.rb @@ -3,4 +3,5 @@ class Paper < ActiveRecord::Base validates :venue, presence: true validates :year, presence: true, numericality: { only_integer: true } has_and_belongs_to_many :authors + scope :published_in, ->(year) { where("year == ?", year) } end