-
Notifications
You must be signed in to change notification settings - Fork 32
Set
Vinicius Stock edited this page Sep 23, 2019
·
1 revision
Sail.set(:my_set_setting, ["Mark", "John"])
Sail.set(:my_set_setting, "Mark;John")
Sail.get(:my_set_setting)
=> #<Set: {"Mark", "John"}>
Sail.get(:my_array_setting) do |setting_value|
puts setting_value
end
=> #<Set: {"Mark", "John"}>
Set settings can be configured to be used for defining specific lists that may need to be changed live.
class Post < ApplicationRecord
.
.
.
def belongs_to_promotion?
Sail.get(:promotion_post_ids).include?(id)
end
end