Skip to content

Commit

Permalink
Added scope to paper. Closes #42
Browse files Browse the repository at this point in the history
  • Loading branch information
manner committed Nov 9, 2017
1 parent dfc4d0a commit 8802f1a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/paper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8802f1a

Please sign in to comment.