Skip to content

Commit

Permalink
Fix failing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
wkirby committed Aug 24, 2024
1 parent 2d42ecd commit 48088fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/audited/auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def revisions(from_version = 1)
end

def has_version?(version)
audits.loaded? ? audits.any? { |audit| audit.version >= from_version } : audits.from_version(from_version).exists?
audits.loaded? ? audits.any? { |audit| audit.version >= version } : audits.from_version(version).exists?
end

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

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

Expand Down Expand Up @@ -332,7 +332,7 @@ def audits_to(version = nil)
end
end

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

def audit_create
Expand Down

0 comments on commit 48088fc

Please sign in to comment.