diff options
| author | mo khan <mo@mokhan.ca> | 2016-05-28 08:38:43 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2016-05-28 08:38:43 -0600 |
| commit | 8be0dbbbafecb2065b2dbbb161dd6f31fe51ceb8 (patch) | |
| tree | 3911765c72e06fe7401735f009985a8888e293d7 /app/controllers/profiles_controller.rb | |
| parent | cd79878b91a6b2bffde89cf34774b62a0e4dbc62 (diff) | |
update gyms#create to create a gym using the yelp id.
Diffstat (limited to 'app/controllers/profiles_controller.rb')
| -rw-r--r-- | app/controllers/profiles_controller.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index e56a45a..687962d 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -12,12 +12,7 @@ class ProfilesController < ApplicationController def update profile = current_user.profile - ActiveRecord::Base.transaction do - if params[:home_gym_yelp_id].present? - profile.gym = Gym.create_from_yelp!(params[:home_gym_yelp_id]) - end - profile.update(profile_params) - end + profile.update(profile_params) flash[:notice] = t("profiles.edit.profile_update_success") redirect_to profile_path(profile) end @@ -25,6 +20,6 @@ class ProfilesController < ApplicationController private def profile_params - params.require(:profile).permit(:gender, :social_tolerance, :time_zone) + params.require(:profile).permit(:gender, :social_tolerance, :time_zone, :gym_id) end end |
