This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias lastweek='git log --author="`git config user.name`" --pretty=format:"%cd %h %s" --date=short --after={`chronic monday of last week`} --before={`chronic last sunday`}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.pending_multi_deployment_ids( user, date = Time.zone.now.to_date ) | |
end_date = date - user.off_cycle_delta | |
SurveyDeployment.select_ids.active.start_on_lte( date ).end_on_gte( end_date ).group_ids_in( user.group_ids ).multi.type_null.map(&:id) | |
end | |
def self.pending_single_deployment_ids( user, date = Time.zone.now.to_date ) | |
end_date = date - user.off_cycle_delta | |
singles = SurveyDeployment.select_ids.active.single.start_on_lte( date ).end_on_gte( end_date ).group_ids_in( user.group_ids ).type_null | |
return [] if singles.empty? | |
taken = SurveyResponse.select_distinct_survey_deployment_ids.survey_deployment_ids_in( singles.map(&:id) ).user_id_is( user.id ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fast_context "Basic Usage" do | |
setup do | |
@sy = Factory :school_year | |
@pgm = Factory :program | |
@rgn = Factory :region | |
@acct = Account.default | |
@rotation = Role.create! :name => 'Rotational Faculty', :school_year_required => true, :program_required => true, :region_required => true, :account => @acct | |
@grp = RoleGroup.create! :name => 'Pediatric', :role => @rotation, :account => @acct, :program => @pgm, :school_year => @sy, :region => @rgn | |
end |