Skip to content

Commit

Permalink
Remove deprecates #scope with hash (see papyri#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfb committed Jan 26, 2021
1 parent dd42dc1 commit 5322485
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions app/models/board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ class Board < ActiveRecord::Base
#board rank determines workflow order for publication
#ranked scopes returns the boards for a given community in order of their rank
#ranked left as default for sosol ranks
scope :ranked, :order => 'rank ASC', :conditions => { 'community_id' => nil }
scope :ranked, -> { where(community_id: nil).order(rank: :asc) }

scope :ranked_by_community_id, lambda { |id_in| { :order => 'rank ASC', :conditions => [ 'community_id = ?', id_in ] } }


scope :ranked_by_community_id, lambda { |id_in| { where(community_id: id_in).order(rank: :asc) } }

# :identifier_classes is an array of identifier classes this board has
# commit control over. This isn't done relationally because it's not a
Expand Down
10 changes: 5 additions & 5 deletions app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class Comment < ActiveRecord::Base
belongs_to :identifier

#create named scope for each type of reason
scope :commit, :conditions => { :reason => 'commit' }
scope :finalizing, :conditions => { :reason => 'finalizing' }
scope :submit, :conditions => { :reason => 'submit' }
scope :general, :conditions => { :reason => 'general' }
scope :vote, :conditions => { :reason => 'vote' }
scope :commit, -> ( where(reason: 'commit') }
scope :finalizing, -> ( where(reason: 'finalizing') }
scope :submit, -> ( where(reason: 'submit') }
scope :general, -> ( where(reason: 'general') }
scope :vote, -> ( where(reason: 'vote') }

def comment=(comment_text)
write_attribute(:comment, CGI.escape(comment_text))
Expand Down

0 comments on commit 5322485

Please sign in to comment.