Skip to content

Commit d3529cd

Browse files
committed
Replace #find(:all) with #where (see papyri#271)
1 parent 96ba302 commit d3529cd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

app/models/apis_identifier.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ def self.collection_names_hash
5555
# - temporary identifier name
5656
def self.next_temporary_identifier(apis_collection)
5757
year = Time.now.year
58-
latest = self.find(:all,
59-
:conditions => ["name like ?", "papyri.info/#{self::IDENTIFIER_NAMESPACE}/#{apis_collection}.apis.#{year}-%"],
60-
:order => "name DESC",
61-
:limit => 1).first
58+
latest = self.where('name like ?', "papyri.info/#{self::IDENTIFIER_NAMESPACE}/#{apis_collection}.apis.#{year}-%").order(name: :desc).limit(1).first
6259
if latest.nil?
6360
# no constructed id's for this year/class
6461
document_number = 1

0 commit comments

Comments
 (0)