Skip to content
This repository was archived by the owner on Dec 16, 2019. It is now read-only.

Conversation

@emer7
Copy link

@emer7 emer7 commented Feb 20, 2017

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 87d2f01 on controllers into ab78af8 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.8%) to 96.222% when pulling 2445fe3 on controllers into ab78af8 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-5.9%) to 94.103% when pulling 7958653 on controllers into ab78af8 on master.


redirect_to action: 'index' if @timeslot_id.update(@user_id)
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add private here

redirect_to action: 'index' if @duty_id.update(@user_id)
end

def setdefault
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_default

def index
date = params[:date]
starting_date = date - (date.cwdays - 1)
@duties = Array.new(7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array.new(starting_date..(starting_date + 7)) does this work?

end

def process_grab
@user_id = User.find(user_id_params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@user not @user_id

redirect_to action: 'index' if @duty_id.update(:user_id, nil)
end

def edit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to do a mass update, just like in the old duty website. Maybe check the current admin panel?

@user_id = User.find(user_id_params)
@duty_id = Duty.find(duty_id_params)

# user_id of duty_id should and must be null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get what's this?

redirect_to action: 'index' if @timeslot_id.update(@user_id)
end

def user_id_params
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user_params

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, actually what is this for?

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.6%) to 98.413% when pulling fdf3efd on controllers into ab78af8 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.6%) to 98.421% when pulling 5c4ecec on controllers into ab78af8 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.6%) to 98.421% when pulling a65d01e on controllers into ab78af8 on master.

@donjar
Copy link
Contributor

donjar commented Mar 4, 2017

Progress?

Copy link
Contributor

@donjar donjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gogogo

expect(flash[:notice]).to eq 'Successfully grabbed duty!'
end

it 'shows error if user is not found' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:o what

week_offset = params[:week_offset]
day_offset = (Time.zone.now.wday - 1) % 7
start_date = Time.zone.now - day_offset.days + week_offset.weeks
@duties = Duty.where("date >= #{start_date} && " \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be abstracted out to be a model function, something like Duty.week_of(Time.zone.now - 7.days)?

@emer7 emer7 closed this Mar 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants