Created
September 7, 2012 15:17
-
-
Save kenton/3667077 to your computer and use it in GitHub Desktop.
This file contains 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
if self.respond_to?(:current_user) && current_user.present? | |
is_operator_facing = current_user.is_operator? | |
elsif local_assigns[:is_operator_facing] | |
is_operator_facing = local_assigns[:is_operator_facing] | |
else | |
is_operator_facing = false | |
end | |
#### ... some other unrelated code #### | |
if is_operator_facing | |
rp = rr.ride_pricing.reprice_without_promo_code | |
end |
This file contains 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
## within vehicle_side_bar partial | |
if current_user | |
is_operator_facing = current_user.is_operator? | |
elsif local_assigns[:is_operator_facing] | |
is_operator_facing = local_assigns[:is_operator_facing] | |
else | |
is_operator_facing = false | |
end | |
# then including :locals => {:current_user => current_user} | |
## original code: | |
if current_user && current_user.is_operator? | |
rp = rr.ride_pricing.reprice_without_promo_code | |
end | |
# updated_code | |
if is_operator_facing | |
rp = rr.ride_pricing.reprice_without_promo_code | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment