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
-
#latest ⇒ Object
Finds latest version of the model.
-
#revision(version) ⇒ Array
Finds all models with a specific version.
Instance Method Details
#latest ⇒ Object
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.
62 63 64 |
# File 'lib/ronin/model/has_version.rb', line 62 def revision(version) all(:version => version.to_s) end |