HER-62-Create-Availability-Controller #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HER-62-Create-Availability-Controller
https://raquelanaroman.atlassian.net/browse/HER-62
Description
To allow speaker users to manage their availability, we need to create an AvailabilitiesController for handling Availability resources. This controller will manage CRUD operations for the Availability model.
Acceptance Criteria
Implementation
class Api::V1::AvailabilitiesController < ApplicationController
before_action :set_availability, only: [:show, :update, :destroy]
end
end
config/routes.rb
namespace :api do
namespace :v1 do
# Rest of routes
resources :availabilities, only: [:index, :show, :create, :update, :destroy]
end
end
Ensure relationships in models:
class Availability < ApplicationRecord
belongs_to :speaker
belongs_to :recurring_availability
end
class Speaker < ApplicationRecord
has_many :availabilities
end
class RecurringAvailability < ApplicationRecord
has_many :availabilities
end
Her-64, HER-51
Changes
created an availabilities controller
added availabilites to routes
created tests for availabilites
Review Checklist