Skip to content

Instantly share code, notes, and snippets.

@andresprogra
Created May 22, 2018 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresprogra/7523c05ad7e01246c1502625d0c62319 to your computer and use it in GitHub Desktop.
Save andresprogra/7523c05ad7e01246c1502625d0c62319 to your computer and use it in GitHub Desktop.
type Plan struct {
[....]
Active bool `json:"active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
db.Model(&plan).Where("id = ?", id).Updates(Plan{
Name: name,
Period: period,
IntervalCount: interval_count,
Currency: currency,
Amount: amount,
LimitUsers: limit_users,
Active: !(status == 0),
TrialPeriodDays: trial_period_days,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment