Module: Ronin::Model::HasAuthors::ClassMethods
- Defined in:
- lib/ronin/model/has_authors.rb
Overview
Class methods that are added when Ronin::Model::HasAuthors is included into a model.
Instance Method Summary collapse
-
#written_by(name) ⇒ Array<Model>
Finds all resources associated with a given author.
-
#written_for(name) ⇒ Array<Model>
Finds all resources associated with a given organization.
Instance Method Details
#written_by(name) ⇒ Array<Model>
Finds all resources associated with a given author.
67 68 69 |
# File 'lib/ronin/model/has_authors.rb', line 67 def written_by(name) all('authors.name.like' => "%#{name}%") end |
#written_for(name) ⇒ Array<Model>
Finds all resources associated with a given organization.
82 83 84 |
# File 'lib/ronin/model/has_authors.rb', line 82 def written_for(name) all('authors.organization.like' => "%#{name}%") end |