Skip to content

Commit

Permalink
Merge branch 'hotfix' for release 2.4.11
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainbx committed Mar 15, 2017
2 parents 5783f82 + b1abf35 commit d9cf6af
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .fabmanager-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.10
2.4.11
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog Fab Manager

## v2.4.11 2017 March 15
- Fix a bug: editing and saving a plan, result in removing the rolling attribute
- [TODO DEPLOY] `rake fablab:fix:rolling_plans`

## v2.4.10 2017 January 9

- Optimized notifications system
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/controllers/admin/plans.coffee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal',
interval: null
intervalCount: 0
amount: null
isRolling: false
is_rolling: false
partnerId: null
partnerContact: null
ui_weight: 0
Expand Down
4 changes: 2 additions & 2 deletions app/assets/templates/admin/plans/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<div class="input-group m-t-md">
<label for="plan[is_rolling]" class="control-label m-r-md">{{ 'rolling_subscription' | translate }} *</label>
<input bs-switch
ng-model="plan.isRolling"
ng-model="plan.is_rolling"
id="plan[is_rolling]"
ng-if="method != 'PATCH'"
type="checkbox"
Expand All @@ -110,7 +110,7 @@
ng-true-value="'true'"
ng-false-value="'false'"/>
<span ng-if="method == 'PATCH'">{{ (plan.is_rolling ? 'yes' : 'no') | translate }}</span>
<input type="hidden" name="plan[is_rolling]" value="{{plan.isRolling}}"/>
<input type="hidden" name="plan[is_rolling]" value="{{plan.is_rolling}}"/>
<span class="help-block">
{{ 'a_rolling_subscription_will_begin_the_day_of_the_first_training' | translate }}
{{ 'otherwise_it_will_begin_as_soon_as_it_is_bought' | translate }}
Expand Down
9 changes: 9 additions & 0 deletions lib/tasks/fablab/fix.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@ namespace :fablab do
e.save!
end
end

task rolling_plans: :environment do
Plan.where(is_rolling: nil).each do |p|
if p.is_rolling.nil? and p.is_rolling != false
p.is_rolling = true
p.save!
end
end
end
end
end

0 comments on commit d9cf6af

Please sign in to comment.