Class: Deed
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Deed
- Includes:
- Checkable, HasOwner, HasUuid, Toggleable
- Defined in:
- app/models/deed.rb
Overview
Deed offer of request
Attributes:
agent_id [Agent]
comments_count [Integer]
created_at [DateTime]
data [JSON]
description [Text], optional
done [Boolean]
image [SimpleImageUploader]
ip [Inet]
offer [Boolean]
region_id [Region], optional
title [String]
updated_at [DateTime]
user_id [User]
uuid [UUID]
view_count [Integer]
visible [Boolean]
Constant Summary collapse
- DESCRIPTION_LIMIT =
65_535- TITLE_LIMIT =
255
Class Method Summary collapse
- .entity_parameters ⇒ Object
- .page_for_administration(page = 1) ⇒ Object
- .page_for_owner(user, page = 1) ⇒ Object
- .page_for_visitors(page = 1) ⇒ Object
Instance Method Summary collapse
Class Method Details
.entity_parameters ⇒ Object
70 71 72 |
# File 'app/models/deed.rb', line 70 def self.entity_parameters i[description done image offer region_id title] end |
.page_for_administration(page = 1) ⇒ Object
55 56 57 |
# File 'app/models/deed.rb', line 55 def self.page_for_administration(page = 1) list_for_administration.page(page) end |
.page_for_owner(user, page = 1) ⇒ Object
66 67 68 |
# File 'app/models/deed.rb', line 66 def self.page_for_owner(user, page = 1) owned_by(user).recent.page(page) end |
.page_for_visitors(page = 1) ⇒ Object
60 61 62 |
# File 'app/models/deed.rb', line 60 def self.page_for_visitors(page = 1) list_for_visitors.page(page) end |
Instance Method Details
#commentable_by?(user) ⇒ Boolean
75 76 77 |
# File 'app/models/deed.rb', line 75 def commentable_by?(user) !user.nil? end |