podemos-info/census

View on GitHub
app/queries/versionable_last_versions.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class VersionableLastVersions < Rectify::Query
  def self.for(versionable)
    new(versionable).query
  end

  def initialize(versionable)
    @versionable = versionable
  end

  def query
    @versionable.versions.reorder(id: :desc).limit(3)
  end
end