Created
November 15, 2019 12:57
-
-
Save kianaditya/5eb7b08996c37b1cef01dd3429f9f4eb to your computer and use it in GitHub Desktop.
Google hangouts in rails - event model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Event < ApplicationRecord | |
validates_presence_of :title, message: "can't be blank" | |
validates_presence_of :description, message: "can't be blank" | |
validates_presence_of :start_date, message: "can't be blank" | |
validates_presence_of :end_date, message: "can't be blank" | |
after_create :create_calendar_event | |
def create_calendar_event | |
GoogleMeetService.create_google_event(self) unless Rails.env.test? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment