Class: Album
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Album
- Includes:
- HasOwner, Toggleable
- Defined in:
- app/models/album.rb
Constant Summary collapse
- PER_PAGE =
20
Class Method Summary collapse
- .entity_parameters ⇒ Object
- .page_for_administration(page = 1) ⇒ Object
- .page_for_visitors(page = 1) ⇒ Object
Instance Method Summary collapse
Class Method Details
.entity_parameters ⇒ Object
34 35 36 |
# File 'app/models/album.rb', line 34 def self.entity_parameters %i(name image description) end |
.page_for_administration(page = 1) ⇒ Object
25 26 27 |
# File 'app/models/album.rb', line 25 def self.page_for_administration(page = 1) recent.page(page).per(PER_PAGE) end |
.page_for_visitors(page = 1) ⇒ Object
30 31 32 |
# File 'app/models/album.rb', line 30 def self.page_for_visitors(page = 1) recent.page(page).per(PER_PAGE) end |
Instance Method Details
#editable_by?(user) ⇒ Boolean
39 40 41 |
# File 'app/models/album.rb', line 39 def editable_by?(user) owned_by?(user) end |