Sha256: 7c31226996fd90bf3dc5c3682eea5f59245bcde62842def8581f80aac42b9005
Contents?: true
Size: 342 Bytes
Versions: 11
Compression:
Stored size: 342 Bytes
Contents
class Book < ActiveRecord::Base # Rolify Gem resourcify # FriendlyId Gem extend FriendlyId friendly_id :title, use: [:slugged, :method_scopes], scope_methods: :also_written_by def authors Author.with_role(:author, self) end def also_written_by Book.where(id: authors.collect { |o| o.books.ids }.flatten ) end end
Version data entries
11 entries across 11 versions & 1 rubygems