Skip to content

Commit 16cafe1

Browse files
committed
avoid ActiveRecord 5.0 deprecations
1 parent b25fed3 commit 16cafe1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/oai/provider/model/activerecord_caching_wrapper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def select_partial(token)
111111
end
112112

113113
def sweep_cache
114-
OaiToken.destroy_all(["created_at < ?", Time.now - expire])
114+
OaiToken.where(["created_at < ?", Time.now - expire]).destroy_all
115115
end
116116

117117
def hydrate_records(records)

test/activerecord_provider/database/0001_oaipmh_tables.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class OaipmhTables < ActiveRecord::Migration
1+
class OaipmhTables < ActiveRecord::Migration[4.2]
22
def self.up
33
create_table :oai_tokens do |t|
44
t.column :token, :string, :null => false

test/activerecord_provider/models/exclusive_set_dc_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class ExclusiveSetDCField < ActiveRecord::Base
33

44
def self.sets
55
klass = Struct.new(:name, :spec)
6-
self.uniq.pluck('`set`').compact.map do |spec|
6+
self.distinct.pluck('`set`').compact.map do |spec|
77
klass.new("Set #{spec}", spec)
88
end
99
end

0 commit comments

Comments
 (0)