Skip to content

Commit 48088fc

Browse files
committed
Fix failing specs
1 parent 2d42ecd commit 48088fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/audited/auditor.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def revisions(from_version = 1)
157157
end
158158

159159
def has_version?(version)
160-
audits.loaded? ? audits.any? { |audit| audit.version >= from_version } : audits.from_version(from_version).exists?
160+
audits.loaded? ? audits.any? { |audit| audit.version >= version } : audits.from_version(version).exists?
161161
end
162162

163163
# Get a specific revision specified by the version number, or +:previous+
@@ -170,7 +170,7 @@ def revision(version)
170170

171171
# Find the oldest revision recorded prior to the date/time provided.
172172
def revision_at(date_or_time)
173-
targeted_audits = audits.loaded? ? audits.filter { |audit| audit.created_at <= date_or_time }.sort_by(&:version) : audits.up_until(date_or_time)
173+
targeted_audits = audits.loaded? ? audits.select { |audit| audit.created_at <= date_or_time }.sort_by(&:version) : audits.up_until(date_or_time)
174174
revision_with Audited.audit_class.reconstruct_attributes(targeted_audits) unless targeted_audits.empty?
175175
end
176176

@@ -332,7 +332,7 @@ def audits_to(version = nil)
332332
end
333333
end
334334

335-
audits.loaded? ? audits.filter { |audit| audit.version <= version }.sort_by(&:version) : audits.to_version(version)
335+
audits.loaded? ? audits.select { |audit| audit.version <= version }.sort_by(&:version) : audits.to_version(version)
336336
end
337337

338338
def audit_create

0 commit comments

Comments
 (0)