Refactor segment constant into a class method
We're going to make it dynamic using the geozones. Besides, class methods can be overwritten using custom models, while constants can't be overwritten without getting a warning [1]. Makes the definition of segments with geozones a little cleaner. I think it’s worth it, compared to the slight memory gain of using a constant [2]. [1] warning: already initialized constant UserSegments::SEGMENTS [2] https://stackoverflow.com/questions/15903835/class-method-vs-constant-in-ruby-rails#answer-15903970
This commit is contained in:
@@ -215,7 +215,7 @@ describe "Admin Notifications", :admin do
|
||||
end
|
||||
|
||||
scenario "Select list of users to send notification" do
|
||||
UserSegments::SEGMENTS.each do |user_segment|
|
||||
UserSegments.segments.each do |user_segment|
|
||||
segment_recipient = I18n.t("admin.segment_recipient.#{user_segment}")
|
||||
|
||||
visit new_admin_admin_notification_path
|
||||
|
||||
Reference in New Issue
Block a user