Skip to content

Instantly share code, notes, and snippets.

@kianaditya
Created November 15, 2019 12:57
Show Gist options
  • Save kianaditya/5eb7b08996c37b1cef01dd3429f9f4eb to your computer and use it in GitHub Desktop.
Save kianaditya/5eb7b08996c37b1cef01dd3429f9f4eb to your computer and use it in GitHub Desktop.
Google hangouts in rails - event model
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