You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
elsif@edit[:new][key] == @edit[:current][key].to_s# check string / integer case
190
+
next
191
+
elsifkey == :roles# check role values
192
+
if(@edit[:new][key] == ["_ALL_"] || @edit[:new][key] == []) && (@edit[:current][key].nil? || @edit[:current][key] == ["all"] || @edit[:current][key] == ["_ALL_"])# if visibility is set to "To All"
193
+
next
194
+
elsif@edit[:new][key].sort == @edit[:current][key].sort# check if new roles array and current roles array are equal after sorting the ids
195
+
next
196
+
else# if new roles array and current roles array are not equal
197
+
@changed=session[:changed]=true
198
+
break
199
+
200
+
end
201
+
elsifkey == :attrs# check attribute values
202
+
@edit[:new][key].each_with_indexdo |_item,index|
203
+
if(@edit[:new][:attrs][index] == [""] || @edit[:new][:attrs][index] == ["",""]) && @edit[:current][:attrs][index] == []# check if attribute and value field is empty
204
+
next
205
+
elsif@edit[:new][:attrs][index] == [] && @edit[:current][:attrs][index] == []# check if attribute or value field is empty
206
+
next
207
+
else# if new attribute array and current attribute array are not equal
208
+
@changed=session[:changed]=true
209
+
break
210
+
211
+
end
212
+
end
213
+
214
+
elsifkey == :visibility_typ# check visibility type
215
+
if@edit[:new][key] == "all" && @edit[:current][key].nil?# if visibility is set to "To All"
216
+
next
217
+
elsif@edit[:new][key] == "role" && @edit[:new][:roles] == []# if visibility type is set to "To Role" and no roles are selected
218
+
next
219
+
else# if new visibility type value and current visibility type value are not equal
220
+
@changed=session[:changed]=true
221
+
break
222
+
223
+
end
224
+
else# if new value and current value are not equal
0 commit comments