Class: Comunit::Network::Handlers::PollHandler
- Inherits:
-
Comunit::Network::Handler
- Object
- Comunit::Network::Handler
- Comunit::Network::Handlers::PollHandler
- Defined in:
- app/services/comunit/network/handlers/poll_handler.rb
Overview
Handling polls
Constant Summary
Constants inherited from Comunit::Network::Handler
Comunit::Network::Handler::MAIN_HOST
Instance Attribute Summary
Attributes inherited from Comunit::Network::Handler
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Comunit::Network::Handler
[], #amend, #entity_class, #initialize, #pull, #pull_and_validate, #push, relationship_data
Methods included from Sending
Methods included from Logging
#log, #log_error, #log_info, #log_warn
Constructor Details
This class inherits a constructor from Comunit::Network::Handler
Class Method Details
.ignored_attributes ⇒ Object
15 16 17 18 19 20 |
# File 'app/services/comunit/network/handlers/poll_handler.rb', line 15 def self.ignored_attributes %w[ agent_id comments_count data id poll_questions_count pollable_id pollable_type simple_image_id updated_at user_id ] end |
.permitted_attributes ⇒ Object
8 9 10 11 12 13 |
# File 'app/services/comunit/network/handlers/poll_handler.rb', line 8 def self.permitted_attributes %i[ active allow_comments anonymous_votes created_at description end_date exclusive ip name open_results show_on_homepage visible ] end |
Instance Method Details
#prepare_model_data ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/services/comunit/network/handlers/poll_handler.rb', line 22 def prepare_model_data data = { id: entity.uuid, type: entity.class.table_name, attributes: attributes_for_remote, relationships: relationships_for_remote, meta: {} } data[:meta][:agent] = entity.agent&.name data end |