lib/sequel/plugins/list.rb in sequel-4.18.0 vs lib/sequel/plugins/list.rb in sequel-4.19.0
- old
+ new
@@ -61,11 +61,11 @@
when Symbol
model.dataset = model.dataset.order_prepend(scope)
proc{|obj| obj.model.filter(scope=>obj.send(scope))}
when Array
model.dataset = model.dataset.order_prepend(*scope)
- proc{|obj| obj.model.filter(scope.map{|s| [s, obj.send(s)]})}
+ proc{|obj| obj.model.filter(scope.map{|s| [s, obj.get_column_value(s)]})}
else
scope
end
end
@@ -88,12 +88,12 @@
end
# Set the value of the position_field to the maximum value plus 1 unless the
# position field already has a value.
def before_create
- unless send(position_field)
- send("#{position_field}=", list_dataset.max(position_field).to_i+1)
+ unless get_column_value(position_field)
+ set_column_value("#{position_field}=", list_dataset.max(position_field).to_i+1)
end
super
end
# When destroying an instance, move all entries after the instance down
@@ -166,10 +166,10 @@
n == 0 ? self : at_position(position_value + n)
end
# The value of the model's position field for this instance.
def position_value
- send(position_field)
+ get_column_value(position_field)
end
# The model instance the given number of places below this model instance
# in the list, or 1 place below if no argument is given.
def prev(n = 1)