Class: ActivityNotification::ORM::Dynamoid::Notification
- Inherits:
-
Object
- Object
- ActivityNotification::ORM::Dynamoid::Notification
- Includes:
- ActiveModel::AttributeAssignment, Association, Common, DynamoidExtension, NotificationApi, Renderable, Dynamoid::Document, GlobalID::Identification
- Defined in:
- lib/activity_notification/orm/dynamoid/notification.rb
Overview
Notification model implementation generated by ActivityNotification.
Class Method Summary collapse
-
.raise_delete_restriction_error(error_text) ⇒ void
Raise ActivityNotification::DeleteRestrictionError for notifications.
Instance Method Summary collapse
-
#group ⇒ Object
Belongs to group instance of this notification as polymorphic association using composite key.
-
#group_members ⇒ Dynamoid::Criteria::Chain
Has many group member notification instances of this notification.
-
#group_owner ⇒ Notification
Customized method that belongs to group owner notification instance of this notification.
-
#group_owner? ⇒ Boolean
Returns if the notification is group owner.
-
#notifiable ⇒ Object
Belongs to notifiable instance of this notification as polymorphic association using composite key.
-
#notifier ⇒ Object
Belongs to :otifier instance of this notification.
-
#target ⇒ Object
Belongs to target instance of this notification as polymorphic association using composite key.
Methods included from NotificationApi
all_index!, available_options, earliest, earliest!, #earliest_order, #earliest_order!, #email_subscribed?, filtered_by_key, filtered_by_options, filtered_by_target_type, filtered_by_type, generate_notification, #group_member?, #group_member_count, group_member_exists?, #group_member_exists?, #group_member_notifier_count, #group_member_notifier_exists?, #group_notification_count, #group_notifier_count, latest, latest!, #latest_group_member, #latest_order, #latest_order!, #notifiable_path, notify, notify_all, notify_all_later, notify_later, notify_later_to, notify_to, #open!, open_all_of, #opened?, opened_index, #optional_target_names, #optional_target_subscribed?, #optional_targets, #prepare_to_store, #printable_notifiable_name, #publish_to_optional_targets, #remove_from_group, send_batch_notification_email, #send_notification_email, set_notification_mailer, #subscribed?, uniq_keys, #unopened?, unopened_index, valid_group_owner
Methods included from Association
belongs_to_composite_xdb_record, belongs_to_polymorphic_xdb_record, filtered_by_association, has_many_composite_xdb_records, has_many_polymorphic_xdb_records, has_many_records, #update
Methods included from Renderable
#layout_path, #partial_path, #prepare_assigns, #prepare_locals, #prepare_parameters, #render, #text
Methods included from Common
#printable_name, #printable_type, #resolve_value, #to_class_name, #to_resource_name, #to_resources_name
Methods included from DynamoidExtension
Class Method Details
.raise_delete_restriction_error(error_text) ⇒ void
This method returns an undefined value.
Raise ActivityNotification::DeleteRestrictionError for notifications.
121 122 123 |
# File 'lib/activity_notification/orm/dynamoid/notification.rb', line 121 def self.raise_delete_restriction_error(error_text) raise ActivityNotification::DeleteRestrictionError, error_text end |
Instance Method Details
#group ⇒ Object
Belongs to group instance of this notification as polymorphic association using composite key.
33 |
# File 'lib/activity_notification/orm/dynamoid/notification.rb', line 33 belongs_to_composite_xdb_record :group |
#group_members ⇒ Dynamoid::Criteria::Chain
Has many group member notification instances of this notification. Only group owner instance has :group_members value. Group member instance has nil as :group_members association. has_many :group_members, class_name: “ActivityNotification::Notification”, foreign_key: :group_owner_id
60 61 62 |
# File 'lib/activity_notification/orm/dynamoid/notification.rb', line 60 def group_members Notification.where(group_owner_id: id) end |
#group_owner ⇒ Notification
Customized method that belongs to group owner notification instance of this notification.
45 |
# File 'lib/activity_notification/orm/dynamoid/notification.rb', line 45 belongs_to :group_owner, { class_name: "ActivityNotification::Notification", foreign_key: :group_owner_id }.merge(Rails::VERSION::MAJOR >= 5 ? { optional: true } : {}) |
#group_owner? ⇒ Boolean
Returns if the notification is group owner. Calls NotificationApi#group_owner? as super method.
113 114 115 |
# File 'lib/activity_notification/orm/dynamoid/notification.rb', line 113 def group_owner? super end |
#notifiable ⇒ Object
Belongs to notifiable instance of this notification as polymorphic association using composite key.
28 |
# File 'lib/activity_notification/orm/dynamoid/notification.rb', line 28 belongs_to_composite_xdb_record :notifiable, store_with_associated_records: true |
#notifier ⇒ Object
Belongs to :otifier instance of this notification.
67 |
# File 'lib/activity_notification/orm/dynamoid/notification.rb', line 67 belongs_to_composite_xdb_record :notifier, store_with_associated_records: true |
#target ⇒ Object
Belongs to target instance of this notification as polymorphic association using composite key.
23 |
# File 'lib/activity_notification/orm/dynamoid/notification.rb', line 23 belongs_to_composite_xdb_record :target, store_with_associated_records: true |