lib/lookbook/stores/panel_store.rb in lookbook-1.3.3 vs lib/lookbook/stores/panel_store.rb in lookbook-1.3.4
- old
+ new
@@ -94,11 +94,11 @@
def self.default_config
config = ConfigLoader.call(CONFIG_FILE)
config.each do |group, panels|
panels.map! do |opts|
opts.transform_values! do |value|
- value.is_a?(String) && value.start_with?("->") ? eval(value) : value # standard:disable Security/Eval
+ (value.is_a?(String) && value.start_with?("->")) ? eval(value) : value # standard:disable Security/Eval
end
end
end
end
@@ -109,10 +109,10 @@
index = insert_index(position, group_panels.count)
group_panels.insert(index, opts.except!(:position))
end
def insert_index(position, items_count)
- index = position == 0 ? 1 : (position || 0).to_int
+ index = (position == 0) ? 1 : (position || 0).to_int
last_position = items_count + 1
index = last_position if index > last_position
index - 1
end