File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1+ # Central location to store FeatureToggles
12class FeatureToggles
23 class << self
3- def reset_data = true
4+ def reset_data? = true
45 end
56end
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ json.current_user do
99 end
1010end
1111
12- json . feature_flags reset_data_feature : FeatureToggles . reset_data
12+ # We often see feature toggle definitions scattered throughout the codebase.
13+ # They should be put in a central location – here we use FeatureToggles.
14+ json . feature_flags reset_data_feature : FeatureToggles . reset_data?
1315json . theme "light-mode"
1416json . locale I18n . locale
1517json . environment Rails . env
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ json.posts do
1515 end
1616 json . highlighted Permissions ::Post . can_edit? ( current_user , post )
1717 # We send permissions to the server so that
18- # the client doesn't have to contain authorization logic.
18+ # the client doesn't have to contain any authorization logic.
1919 json . can_edit_post Permissions ::Post . can_edit? ( current_user , post )
2020 json . created_at post . created_at . iso8601
2121 end
@@ -26,7 +26,7 @@ json.pagination do
2626 json . prev_page @posts . prev_page
2727end
2828# We send permissions to the server so that
29- # the client doesn't have to contain authorization logic.
29+ # the client doesn't have to contain any authorization logic.
3030json . permissions do
3131 json . can_create_post Permissions ::Post . can_create? ( current_user )
3232end
You can’t perform that action at this time.
0 commit comments