Module: Ronin::Model::HasVersion::ClassMethods

Defined in:
lib/ronin/model/has_version.rb

Overview

Class methods that are added when Ronin::Model::HasVersion is included into a model.

Instance Method Summary collapse

Instance Method Details

#latestObject

Finds latest version of the model.



71
72
73
# File 'lib/ronin/model/has_version.rb', line 71

def latest
  first(:order => [:version.desc])
end

#revision(version) ⇒ Array

Finds all models with a specific version.

Parameters:

  • version (String)

    The specific version to search for.

Returns:

  • (Array)

    The models with the specific version.



62
63
64
# File 'lib/ronin/model/has_version.rb', line 62

def revision(version)
  all(:version => version.to_s)
end