app/helpers/spree/api/api_helpers.rb in spree_api-1.3.5 vs app/helpers/spree/api/api_helpers.rb in spree_api-2.0.0.rc1
- old
+ new
@@ -10,20 +10,19 @@
required_fields.map!(&:to_s).delete("permalink")
required_fields
end
def product_attributes
- [:id, :name, :description, :price, :available_on, :permalink,
- :count_on_hand, :meta_description, :meta_keywords, :taxon_ids]
+ [:id, :name, :description, :price, :available_on, :permalink, :meta_description, :meta_keywords, :taxon_ids]
end
def product_property_attributes
[:id, :product_id, :property_id, :value, :property_name]
end
def variant_attributes
- [:id, :name, :count_on_hand, :sku, :price, :weight, :height, :width, :depth, :is_master, :cost_price, :permalink, :product_id, :lock_version]
+ [:id, :name, :sku, :price, :weight, :height, :width, :depth, :is_master, :cost_price, :permalink]
end
def image_attributes
[:id, :position, :attachment_content_type, :attachment_file_name, :type, :attachment_updated_at, :attachment_width, :attachment_height, :alt]
end
@@ -31,11 +30,11 @@
def option_value_attributes
[:id, :name, :presentation, :option_type_name, :option_type_id]
end
def order_attributes
- [:id, :number, :item_total, :total, :state, :adjustment_total, :user_id, :created_at, :updated_at, :completed_at, :payment_total, :shipment_state, :payment_state, :email, :special_instructions, :channel]
+ [:id, :number, :item_total, :total, :state, :adjustment_total, :user_id, :created_at, :updated_at, :completed_at, :payment_total, :shipment_state, :payment_state, :email, :special_instructions]
end
def line_item_attributes
[:id, :quantity, :price, :variant_id]
end
@@ -59,27 +58,55 @@
def taxonomy_attributes
[:id, :name]
end
def taxon_attributes
- [:id, :name, :permalink, :position, :parent_id, :taxonomy_id]
+ [:id, :name, :pretty_name, :permalink, :position, :parent_id, :taxonomy_id]
end
def inventory_unit_attributes
- [:id, :lock_version, :state, :variant_id, :order_id,
- :shipment_id, :return_authorization_id]
+ [:id, :lock_version, :state, :variant_id, :shipment_id, :return_authorization_id]
end
def return_authorization_attributes
[:id, :number, :state, :amount, :order_id, :reason, :created_at, :updated_at]
end
def country_attributes
[:id, :iso_name, :iso, :iso3, :name, :numcode]
end
+ def state_attributes
+ [:id, :name, :abbr, :country_id]
+ end
+
+ def adjustment_attributes
+ [:id, :source_type, :source_id, :adjustable_type, :adjustable_id, :originator_type, :originator_id, :amount, :label, :mandatory, :locked, :eligible, :created_at, :updated_at]
+ end
+
+ def creditcard_attributes
+ [:id, :month, :year, :cc_type, :last_digits, :first_name, :last_name, :gateway_customer_profile_id, :gateway_payment_profile_id]
+ end
+
def user_attributes
[:id, :email, :created_at, :updated_at]
end
+
+ def property_attributes
+ [:id, :name, :presentation]
+ end
+
+ def stock_location_attributes
+ [:id, :name, :address1, :address2, :city, :state_id, :state_name, :country_id, :zipcode, :phone, :active]
+ end
+
+ def stock_movement_attributes
+ [:id, :quantity, :stock_item_id]
+ end
+
+ def stock_item_attributes
+ [:id, :count_on_hand, :backorderable, :lock_version, :stock_location_id, :variant_id]
+ end
end
end
end
+