initialize invites

Invites model,controller and views are initialized.

add datepicker and selectize in invites#new

calender is added for end date field and selectize is added for emails field to allow multiple emails in field
This commit is contained in:
Rahul 2019-08-10 14:07:48 +05:30
parent a96722b3c3
commit 654760c3fc
8 changed files with 77 additions and 2 deletions

View file

@ -33,6 +33,7 @@ class Conference < ApplicationRecord
has_many :resources, dependent: :destroy
has_many :booths, dependent: :destroy
has_many :confirmed_booths, -> { where(state: 'confirmed') }, class_name: 'Booth'
has_many :invites, dependent: :destroy
has_many :lodgings, dependent: :destroy
has_many :registrations, dependent: :destroy

8
app/models/invite.rb Normal file
View file

@ -0,0 +1,8 @@
class Invite < ApplicationRecord
attr_accessor :emails
belongs_to :conference
validates :end_date, presence: true
validates :invite_for, presence: true
validates :user_id, presence: true, uniqueness: { scope: [:invite_for, :conference_id] }
end