Module: CalculateStat::InstanceMethods
- Defined in:
- lib/enju_leaf/calculate_stat.rb
Instance Method Summary collapse
-
#check_date ⇒ Object
利用統計の日付をチェックします。.
-
#send_message ⇒ Object
利用統計の集計完了メッセージを送信します。.
Instance Method Details
#check_date ⇒ Object
利用統計の日付をチェックします。
23 24 25 26 27 28 29 30 |
# File 'lib/enju_leaf/calculate_stat.rb', line 23 def check_date if self.start_date and self.end_date if self.start_date >= self.end_date errors.add(:start_date) errors.add(:end_date) end end end |
#send_message ⇒ Object
利用統計の集計完了メッセージを送信します。
33 34 35 36 37 38 39 40 |
# File 'lib/enju_leaf/calculate_stat.rb', line 33 def sender = User.find(1) #system = MessageTemplate.localized_template('counting_completed', user.profile.locale) request = MessageRequest.new request.assign_attributes({sender: sender, receiver: user, message_template: }) request. request.transition_to!(:sent) end |