mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Swap param order
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class EnterpriseFeeSet < ModelSet
|
||||
def initialize(attributes={})
|
||||
super(EnterpriseFee, EnterpriseFee.all,
|
||||
proc { |attrs| attrs[:name].blank? },
|
||||
attributes)
|
||||
attributes,
|
||||
proc { |attrs| attrs[:name].blank? })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class EnterpriseSet < ModelSet
|
||||
def initialize(collection, attributes={})
|
||||
super(Enterprise, collection, nil, attributes)
|
||||
super(Enterprise, collection, attributes)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ class ModelSet
|
||||
|
||||
attr_accessor :collection
|
||||
|
||||
def initialize(klass, collection, reject_if=nil, attributes={})
|
||||
def initialize(klass, collection, attributes={}, reject_if=nil)
|
||||
@klass, @collection, @reject_if = klass, collection, reject_if
|
||||
|
||||
# Set here first, to ensure that we apply collection_attributes to the right collection
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class OrderCycleSet < ModelSet
|
||||
def initialize(attributes={})
|
||||
super(OrderCycle, OrderCycle.all, nil, attributes)
|
||||
super(OrderCycle, OrderCycle.all, attributes)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Spree::ProductSet < ModelSet
|
||||
def initialize(attributes={})
|
||||
super(Spree::Product, [], proc { |attrs| attrs[:product_id].blank? }, attributes)
|
||||
super(Spree::Product, [], attributes, proc { |attrs| attrs[:product_id].blank? })
|
||||
end
|
||||
|
||||
# A separate method of updating products was required due to an issue with the way Rails' assign_attributes and updates_attributes behave when delegated attributes of a nested
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class VariantOverrideSet < ModelSet
|
||||
def initialize(attributes={})
|
||||
super(VariantOverride, VariantOverride.all, nil, attributes)
|
||||
super(VariantOverride, VariantOverride.all, attributes)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user