Skip to content

Commit

Permalink
Lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcia committed Jan 19, 2025
1 parent 8e6d3d5 commit 2bddedf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/availabilities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def index
end

# Trigger the job to create next month's availabilities if needed
#trigger_recurring_availability_job(viewing_month, viewing_year)
# trigger_recurring_availability_job(viewing_month, viewing_year)

# Fetch the availabilities within the specified date range
@availabilities = Availability.where(start_time: start_date..end_date)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def associate_address_with_user(order)
# Check if the address should be saved to the user
if order.address.save_to_user
# Ensure the address is not already associated with the user or the organization
unless order.user.addresses.exists?(id: order.address.id) ||
unless order.user.addresses.exists?(id: order.address.id) ||
(order.user.organization && order.user.organization.addresses.exists?(id: order.address.id))
order.user.addresses << order.address
end
Expand Down
34 changes: 17 additions & 17 deletions app/serializers/user_profile_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ class UserProfileSerializer
include JSONAPI::Serializer
attributes :name, :email, :id, :bio, :role, :profile_image_url, :organization_id

# attribute :events, if: Proc.new { |user, params| params[:role] == "speaker" || params[:role] == "teacher" } do |user|
# user.events ? user.events.map { |event| EventSerializer.new(event).serializable_hash } : []
# end
# attribute :events, if: Proc.new { |user, params| params[:role] == "speaker" || params[:role] == "teacher" } do |user|
# user.events ? user.events.map { |event| EventSerializer.new(event).serializable_hash } : []
# end

attribute :orders do |user|
if user.orders
Expand Down Expand Up @@ -42,29 +42,29 @@ class UserProfileSerializer
else
{}
end
# attribute :availabilities, if: Proc.new { |user, params| params[:role] == "speaker" || params[:role] == "teacher" } do |user|
# user.availabilities ? user.availabilities.map { |availability| AvailabilitySerializer.new(availability).serializable_hash } : []
# end
# attribute :availabilities, if: Proc.new { |user, params| params[:role] == "speaker" || params[:role] == "teacher" } do |user|
# user.availabilities ? user.availabilities.map { |availability| AvailabilitySerializer.new(availability).serializable_hash } : []
# end

# attribute :pending_bookings, if: Proc.new { |user, params| params[:role] == "speaker" } do |user|
# user.pending_bookings ? user.pending_bookings.map { |booking| BookingSerializer.new(booking).serializable_hash } : []
# end
# attribute :pending_bookings, if: Proc.new { |user, params| params[:role] == "speaker" } do |user|
# user.pending_bookings ? user.pending_bookings.map { |booking| BookingSerializer.new(booking).serializable_hash } : []
# end

# attribute :confirmed_bookings, if: Proc.new { |user, params| params[:role] == "speaker" } do |user|
# user.confirmed_bookings ? user.confirmed_bookings.map { |booking| BookingSerializer.new(booking).serializable_hash } : []
# end
# attribute :confirmed_bookings, if: Proc.new { |user, params| params[:role] == "speaker" } do |user|
# user.confirmed_bookings ? user.confirmed_bookings.map { |booking| BookingSerializer.new(booking).serializable_hash } : []
# end

# attribute :bookings, if: Proc.new { |user, params| params[:role] == "teacher" } do |user|
# user.bookings ? user.bookings.map { |booking| BookingSerializer.new(booking).serializable_hash } : []
# attribute :bookings, if: Proc.new { |user, params| params[:role] == "teacher" } do |user|
# user.bookings ? user.bookings.map { |booking| BookingSerializer.new(booking).serializable_hash } : []
end

attribute :donations do |user|
user.donations ? user.donations.map { |donation| DonationSerializer.new(donation).serializable_hash } : []
end

# attribute :orders, if: Proc.new { |user, params| params[:role] == "teacher" } do |user|
# user.orders ? user.orders.map { |order| OrderSerializer.new(order).serializable_hash } : []
# end
# attribute :orders, if: Proc.new { |user, params| params[:role] == "teacher" } do |user|
# user.orders ? user.orders.map { |order| OrderSerializer.new(order).serializable_hash } : []
# end

def profile_image_url
if @resource.profile_image.attached?
Expand Down

0 comments on commit 2bddedf

Please sign in to comment.