Class: CodeChangeActivity
- Inherits:
-
Object
- Object
- CodeChangeActivity
- Defined in:
- lib/models/code_change_activity.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#code_change ⇒ Object
readonly
Returns the value of attribute code_change.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_self ⇒ Object
readonly
Returns the value of attribute is_self.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
5 6 7 |
# File 'lib/models/code_change_activity.rb', line 5 def @author end |
#code_change ⇒ Object (readonly)
Returns the value of attribute code_change.
5 6 7 |
# File 'lib/models/code_change_activity.rb', line 5 def code_change @code_change end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/models/code_change_activity.rb', line 5 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/models/code_change_activity.rb', line 5 def id @id end |
#is_self ⇒ Object (readonly)
Returns the value of attribute is_self.
5 6 7 |
# File 'lib/models/code_change_activity.rb', line 5 def is_self @is_self end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/models/code_change_activity.rb', line 5 def @message end |
Instance Method Details
#messages_to_ignore ⇒ Object
20 21 22 |
# File 'lib/models/code_change_activity.rb', line 20 def raise NotImplementedError end |
#notified ⇒ Object
7 8 9 10 11 |
# File 'lib/models/code_change_activity.rb', line 7 def notified if id Rubiclifier::DB.execute("INSERT INTO code_change_activity_notified (id, notified_at) VALUES('#{id}', CURRENT_TIMESTAMP);") end end |
#should_notify? ⇒ Boolean
13 14 15 16 17 18 |
# File 'lib/models/code_change_activity.rb', line 13 def should_notify? !is_self && (code_change.activity_from_self_at && created_at > code_change.activity_from_self_at && code_change.includes_self || == "just opened merge request") && .none? { |m| .match(m) } && !Rubiclifier::DB.query_single_row("SELECT id FROM code_change_activity_notified WHERE id = '#{id}'") end |