Module: Ronin::Model::HasLicense::ClassMethods
- Defined in:
- lib/ronin/model/has_license.rb
Overview
Class methods that are added when Ronin::Model::HasLicense is included into a model.
Instance Method Summary collapse
-
#licensed_under(license) ⇒ Array<Model>
Finds all models associated with a given license.
Instance Method Details
#licensed_under(license) ⇒ Array<Model>
Finds all models associated with a given license.
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/ronin/model/has_license.rb', line 79 def licensed_under(license) conditions = case license when License {:license => license} when Symbol {:license => License.predefined_resource(license)} else {'license.name' => license.to_s} end all(conditions) end |