├── .docker └── development.dockerfile ├── .dockerignore ├── .env.example ├── .gitignore ├── .ruby-gemset ├── .ruby-version ├── .solargraph.yml ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── app.json ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ └── .keep │ ├── javascripts │ │ ├── application.js │ │ ├── cable.js │ │ └── channels │ │ │ └── .keep │ └── stylesheets │ │ └── application.css ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── api │ │ ├── accounts_controller.rb │ │ ├── addresses_controller.rb │ │ ├── carts_controller.rb │ │ ├── countries_controller.rb │ │ ├── credit_cards_controller.rb │ │ ├── orders_controller.rb │ │ ├── passwords_controller.rb │ │ ├── payubiz_controller.rb │ │ ├── products_controller.rb │ │ ├── taxonomies_controller.rb │ │ └── taxons_controller.rb │ ├── application_controller.rb │ ├── base_controller.rb │ ├── concerns │ │ ├── .keep │ │ └── csrf.rb │ ├── oauth_controller.rb │ └── spree │ │ ├── api │ │ ├── base_controller_decorator.rb │ │ └── relations_controller.rb │ │ ├── favorite_products_controller.rb │ │ ├── feedback_reviews_controller.rb │ │ ├── products_controller_decorator.rb │ │ ├── reviews_controller.rb │ │ └── user_sessions_controller.rb ├── helpers │ ├── application_helper.rb │ └── order_decorator.rb ├── jobs │ └── application_job.rb ├── mailers │ ├── .keep │ ├── application_mailer.rb │ ├── base_mailer.rb │ └── user_mailer.rb ├── models │ ├── .keep │ ├── application_record.rb │ ├── ckeditor │ │ ├── asset.rb │ │ ├── attachment_file.rb │ │ └── picture.rb │ ├── concerns │ │ └── .keep │ ├── delivery_pincode.rb │ ├── identity.rb │ └── spree │ │ ├── image_decorator.rb │ │ ├── order │ │ └── checkout.rb │ │ └── payment_method │ │ ├── cod.rb │ │ └── payubiz.rb ├── monkey_patch │ └── file_decorator.rb ├── serializers │ ├── address_serializer.rb │ ├── adjustement_serializer.rb │ ├── adjustment_serializer.rb │ ├── base_serializer.rb │ ├── classification_serializer.rb │ ├── country_serializer.rb │ ├── image_serializer.rb │ ├── line_item_serializer.rb │ ├── lite_line_item_serializer.rb │ ├── lite_order_serializer.rb │ ├── lite_user_serializer.rb │ ├── option_type_serializer.rb │ ├── option_value_serializer.rb │ ├── orders_serializer.rb │ ├── payment_method_serializer.rb │ ├── payment_serializer.rb │ ├── payment_source_serializer.rb │ ├── product_property_serializer.rb │ ├── product_serializer.rb │ ├── shipping_category_serializer.rb │ ├── shipping_method_serializer.rb │ ├── shipping_rate_serializer.rb │ ├── small_shipment_serializer.rb │ ├── small_variant_serializer.rb │ ├── state_serializer.rb │ ├── taxon_serializer.rb │ ├── taxonomy_serializer.rb │ ├── user_serializer.rb │ └── zone_serializer.rb ├── services │ ├── oauth.rb │ ├── oauth │ │ ├── base.rb │ │ ├── google.rb │ │ └── user_info.rb │ └── oauth_user_creator.rb └── views │ ├── kaminari │ ├── _first_page.html.erb │ ├── _gap.html.erb │ ├── _last_page.html.erb │ ├── _next_page.html.erb │ ├── _page.html.erb │ ├── _paginator.html.erb │ ├── _prev_page.html.erb │ └── twitter-bootstrap-3 │ │ ├── _first_page.html.erb │ │ ├── _gap.html.erb │ │ ├── _last_page.html.erb │ │ ├── _next_page.html.erb │ │ ├── _page.html.erb │ │ ├── _paginator.html.erb │ │ └── _prev_page.html.erb │ ├── layouts │ ├── application.html.erb │ ├── mailer.html.erb │ └── mailer.text.erb │ ├── spree │ ├── admin │ │ └── invoice │ │ │ ├── _footer.html.erb │ │ │ └── _header.html.erb │ └── api │ │ └── v1 │ │ ├── images │ │ └── show.v1.rabl │ │ ├── orders │ │ ├── index.v1.rabl │ │ ├── mine.v1.rabl │ │ ├── ng_index.v1.rabl │ │ └── ng_mine.v1.rabl │ │ ├── products │ │ ├── index.v1.rabl │ │ ├── ng_classification.v1.rabl │ │ ├── ng_index.v1.rabl │ │ ├── ng_large_show.v1.rabl │ │ ├── ng_option_type.v1.rabl │ │ ├── ng_product_property.v1.rabl │ │ ├── ng_show.v1.rabl │ │ ├── ng_small_show.v1.rabl │ │ └── show.v1.rabl │ │ ├── taxonomies │ │ └── nested.v1.rabl │ │ ├── taxons │ │ └── taxons.v1.rabl │ │ ├── users │ │ └── show.v1.rabl │ │ └── variants │ │ ├── ng_option_value.v1.rabl │ │ ├── ng_small.v1.rabl │ │ ├── ng_small_attrs.v1.rabl │ │ └── small.v1.rabl │ └── user_mailer │ ├── reset_password_instructions.html.erb │ ├── reset_password_instructions.text.erb │ ├── user_registration_instructions.erb │ └── user_registration_instructions.text.erb ├── bin ├── bundle ├── rails ├── rake ├── setup ├── update └── yarn ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── credentials.yml.enc ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── ckeditor.rb │ ├── content_security_policy.rb │ ├── cookies_serializer.rb │ ├── devise.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── rabl_init.rb │ ├── session_store.rb │ ├── spree.rb │ ├── spree_admin_insights.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml ├── puma.rb ├── routes.rb ├── spring.rb ├── storage.yml └── tinymce.yml ├── db ├── migrate │ ├── 20180411082627_spree_one_two.spree.rb │ ├── 20180411082628_spree_promo_one_two.spree.rb │ ├── 20180411082629_add_tax_rate_label.spree.rb │ ├── 20180411082630_add_toggle_tax_rate_display.spree.rb │ ├── 20180411082631_remove_unused_preference_columns.spree.rb │ ├── 20180411082632_add_lock_version_to_variant.spree.rb │ ├── 20180411082633_add_states_required_to_countries.spree.rb │ ├── 20180411082634_add_on_demand_to_product_and_variant.spree.rb │ ├── 20180411082635_remove_not_null_constraint_from_products_on_hand.spree.rb │ ├── 20180411082636_split_prices_from_variants.spree.rb │ ├── 20180411082637_remove_not_null_from_spree_prices_amount.spree.rb │ ├── 20180411082638_add_currency_to_line_items.spree.rb │ ├── 20180411082639_add_currency_to_orders.spree.rb │ ├── 20180411082640_add_cost_currency_to_variants.spree.rb │ ├── 20180411082641_remove_display_on_from_payment_methods.spree.rb │ ├── 20180411082642_add_position_to_taxonomies.spree.rb │ ├── 20180411082643_add_last_ip_to_spree_orders.spree.rb │ ├── 20180411082644_add_state_to_spree_adjustments.spree.rb │ ├── 20180411082645_add_display_on_to_spree_payment_methods.spree.rb │ ├── 20180411082646_add_position_to_product_properties.spree.rb │ ├── 20180411082647_add_identifier_to_spree_payments.spree.rb │ ├── 20180411082648_add_order_id_index_to_payments.spree.rb │ ├── 20180411082649_add_primary_to_spree_products_taxons.spree.rb │ ├── 20180411082650_create_spree_stock_items.spree.rb │ ├── 20180411082651_create_spree_stock_locations.spree.rb │ ├── 20180411082652_create_default_stock.spree.rb │ ├── 20180411082653_add_order_id_index_to_shipments.spree.rb │ ├── 20180411082654_change_meta_description_on_spree_products_to_text.spree.rb │ ├── 20180411082655_add_stock_location_id_to_spree_shipments.spree.rb │ ├── 20180411082656_add_pending_to_inventory_unit.spree.rb │ ├── 20180411082657_remove_on_demand_from_product_and_variant.spree.rb │ ├── 20180411082658_create_shipping_method_zone.spree.rb │ ├── 20180411082659_remove_shipping_category_id_from_shipping_method.spree.rb │ ├── 20180411082660_create_shipping_method_categories.spree.rb │ ├── 20180411082661_add_tracking_url_to_spree_shipping_methods.spree.rb │ ├── 20180411082662_create_spree_shipping_rates.spree.rb │ ├── 20180411082663_remove_category_match_attributes_from_shipping_method.spree.rb │ ├── 20180411082664_create_stock_movements.spree.rb │ ├── 20180411082665_add_address_fields_to_stock_location.spree.rb │ ├── 20180411082666_add_active_field_to_stock_locations.spree.rb │ ├── 20180411082667_add_backorderable_to_stock_item.spree.rb │ ├── 20180411082668_add_default_quantity_to_stock_movement.spree.rb │ ├── 20180411082669_add_source_and_destination_to_stock_movements.spree.rb │ ├── 20180411082670_change_orders_total_precision.spree.rb │ ├── 20180411082671_change_spree_payments_amount_precision.spree.rb │ ├── 20180411082672_change_spree_return_authorization_amount_precision.spree.rb │ ├── 20180411082673_change_adjustments_amount_precision.spree.rb │ ├── 20180411082674_add_originator_to_stock_movement.spree.rb │ ├── 20180411082675_drop_source_and_destination_from_stock_movement.spree.rb │ ├── 20180411082676_migrate_inventory_unit_sold_to_on_hand.spree.rb │ ├── 20180411082677_add_stock_location_to_rma.spree.rb │ ├── 20180411082678_update_shipment_state_for_canceled_orders.spree.rb │ ├── 20180411082679_add_seo_metas_to_taxons.spree.rb │ ├── 20180411082680_remove_stock_item_and_variant_lock.spree.rb │ ├── 20180411082681_add_name_to_spree_credit_cards.spree.rb │ ├── 20180411082682_update_name_fields_on_spree_credit_cards.spree.rb │ ├── 20180411082683_add_index_to_source_columns_on_adjustments.spree.rb │ ├── 20180411082684_update_adjustment_states.spree.rb │ ├── 20180411082685_add_shipping_rates_to_shipments.spree.rb │ ├── 20180411082686_create_spree_stock_transfers.spree.rb │ ├── 20180411082687_drop_products_count_on_hand.spree.rb │ ├── 20180411082688_set_default_shipping_rate_cost.spree.rb │ ├── 20180411082689_add_number_to_stock_transfer.spree.rb │ ├── 20180411082690_add_sku_index_to_spree_variants.spree.rb │ ├── 20180411082691_add_backorderable_default_to_spree_stock_location.spree.rb │ ├── 20180411082692_add_propage_all_variants_to_spree_stock_location.spree.rb │ ├── 20180411082693_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb │ ├── 20180411082694_add_user_id_index_to_spree_orders.spree.rb │ ├── 20180411082695_add_updated_at_to_spree_countries.spree.rb │ ├── 20180411082696_add_updated_at_to_spree_states.spree.rb │ ├── 20180411082697_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb │ ├── 20180411082698_add_unique_index_to_permalink_on_spree_products.spree.rb │ ├── 20180411082699_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb │ ├── 20180411082700_add_deleted_at_to_spree_tax_rates.spree.rb │ ├── 20180411082701_remove_lock_version_from_inventory_units.spree.rb │ ├── 20180411082702_add_cost_price_to_line_item.spree.rb │ ├── 20180411082703_set_backorderable_to_default_to_false.spree.rb │ ├── 20180411082704_add_created_by_id_to_spree_orders.spree.rb │ ├── 20180411082705_index_completed_at_on_spree_orders.spree.rb │ ├── 20180411082706_add_tax_category_id_to_spree_line_items.spree.rb │ ├── 20180411082707_migrate_tax_categories_to_line_items.spree.rb │ ├── 20180411082708_drop_spree_mail_methods.spree.rb │ ├── 20180411082709_set_default_stock_location_on_shipments.spree.rb │ ├── 20180411082710_upgrade_adjustments.spree.rb │ ├── 20180411082711_rename_adjustment_fields.spree.rb │ ├── 20180411082712_add_admin_name_column_to_spree_shipping_methods.spree.rb │ ├── 20180411082713_add_admin_name_column_to_spree_stock_locations.spree.rb │ ├── 20180411082714_add_shipment_total_to_spree_orders.spree.rb │ ├── 20180411082715_expand_order_number_size.spree.rb │ ├── 20180411082716_rename_activators_to_promotions.spree.rb │ ├── 20180411082717_add_adjustment_total_to_line_items.spree.rb │ ├── 20180411082718_add_adjustment_total_to_shipments.spree.rb │ ├── 20180411082719_add_depth_to_spree_taxons.spree.rb │ ├── 20180411082720_add_tax_total_to_line_items_shipments_and_orders.spree.rb │ ├── 20180411082721_add_shipping_category_to_shipping_methods_and_products.spree.rb │ ├── 20180411082722_migrate_old_shipping_calculators.spree.rb │ ├── 20180411082723_add_code_to_spree_promotion_rules.spree.rb │ ├── 20180411082724_change_states_required_for_countries.spree.rb │ ├── 20180411082725_add_deleted_at_to_spree_stock_items.spree.rb │ ├── 20180411082726_remove_promotions_event_name_field.spree.rb │ ├── 20180411082727_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb │ ├── 20180411082728_remove_unused_credit_card_fields.spree.rb │ ├── 20180411082729_add_track_inventory_to_variant.spree.rb │ ├── 20180411082730_add_tax_category_to_variants.spree.rb │ ├── 20180411082731_add_channel_to_spree_orders.spree.rb │ ├── 20180411082732_add_included_to_adjustments.spree.rb │ ├── 20180411082733_rename_tax_total_fields.spree.rb │ ├── 20180411082734_add_line_item_id_to_spree_inventory_units.spree.rb │ ├── 20180411082735_add_updated_at_to_variants.spree.rb │ ├── 20180411082736_add_position_to_classifications.spree.rb │ ├── 20180411082737_create_spree_orders_promotions.spree.rb │ ├── 20180411082738_unique_shipping_method_categories.spree.rb │ ├── 20180411082739_add_item_count_to_spree_orders.spree.rb │ ├── 20180411082740_remove_value_type_from_spree_preferences.spree.rb │ ├── 20180411082741_rename_permalink_to_slug_for_products.spree.rb │ ├── 20180411082742_add_index_to_variant_id_and_currency_on_prices.spree.rb │ ├── 20180411082743_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb │ ├── 20180411082744_add_deleted_at_to_spree_prices.spree.rb │ ├── 20180411082745_add_approver_id_and_approved_at_to_orders.spree.rb │ ├── 20180411082746_add_confirmation_delivered_to_spree_orders.spree.rb │ ├── 20180411082747_add_auto_capture_to_payment_methods.spree.rb │ ├── 20180411082748_create_spree_payment_capture_events.spree.rb │ ├── 20180411082749_add_uncaptured_amount_to_payments.spree.rb │ ├── 20180411082750_default_variant_weight_to_zero.spree.rb │ ├── 20180411082751_add_tax_category_id_to_shipping_methods.spree.rb │ ├── 20180411082752_add_tax_rate_id_to_shipping_rates.spree.rb │ ├── 20180411082753_add_pre_tax_amount_to_line_items_and_shipments.spree.rb │ ├── 20180411082754_add_more_indexes.spree.rb │ ├── 20180411082755_add_considered_risky_to_orders.spree.rb │ ├── 20180411082756_add_preference_store_to_everything.spree.rb │ ├── 20180411082757_add_user_id_to_spree_credit_cards.spree.rb │ ├── 20180411082758_migrate_old_preferences.spree.rb │ ├── 20180411082759_create_spree_stores.spree.rb │ ├── 20180411082760_create_store_from_preferences.spree.rb │ ├── 20180411082761_add_timestamps_to_spree_assets.spree.rb │ ├── 20180411082762_create_spree_taxons_promotion_rules.spree.rb │ ├── 20180411082763_add_additional_store_fields.spree.rb │ ├── 20180411082764_add_many_missing_indexes.spree.rb │ ├── 20180411082765_correct_some_polymorphic_index_and_add_more_missing.spree.rb │ ├── 20180411082766_add_user_id_created_by_id_index_to_order.spree.rb │ ├── 20180411082767_change_spree_price_amount_precision.spree.rb │ ├── 20180411082768_add_token_to_spree_orders.spree.rb │ ├── 20180411082769_move_order_token_from_tokenized_permission.spree.rb │ ├── 20180411082770_set_shipment_total_for_users_upgrading.spree.rb │ ├── 20180411082771_drop_credit_card_first_name_and_last_name.spree.rb │ ├── 20180411082772_add_deleted_at_to_spree_promotion_actions.spree.rb │ ├── 20180411082773_remove_uncaptured_amount_from_spree_payments.spree.rb │ ├── 20180411082774_create_spree_refunds.spree.rb │ ├── 20180411082775_create_spree_return_authorization_inventory_unit.spree.rb │ ├── 20180411082776_rename_return_authorization_inventory_unit_to_return_items.spree.rb │ ├── 20180411082777_backfill_line_item_pre_tax_amount.spree.rb │ ├── 20180411082778_recreate_spree_return_authorizations.spree.rb │ ├── 20180411082779_add_amount_fields_to_return_items.spree.rb │ ├── 20180411082780_drop_return_authorization_amount.spree.rb │ ├── 20180411082781_create_spree_return_authorization_reasons.spree.rb │ ├── 20180411082782_create_spree_refund_reasons.spree.rb │ ├── 20180411082783_rename_return_authorization_reason.spree.rb │ ├── 20180411082784_create_spree_promotion_categories.spree.rb │ ├── 20180411082785_drop_received_at_on_return_items.spree.rb │ ├── 20180411082786_add_reception_and_acceptance_status_to_return_items.spree.rb │ ├── 20180411082787_create_default_refund_reason.spree.rb │ ├── 20180411082788_add_default_to_spree_stock_locations.spree.rb │ ├── 20180411082789_create_spree_customer_returns.spree.rb │ ├── 20180411082790_add_customer_return_id_to_return_item.spree.rb │ ├── 20180411082791_create_friendly_id_slugs.spree.rb │ ├── 20180411082792_rename_spree_refund_return_authorization_id.spree.rb │ ├── 20180411082793_increase_return_item_pre_tax_amount_precision.spree.rb │ ├── 20180411082794_copy_product_slugs_to_slug_history.spree.rb │ ├── 20180411082795_create_spree_reimbursements.spree.rb │ ├── 20180411082796_add_promotionable_to_spree_products.spree.rb │ ├── 20180411082797_add_exchange_inventory_unit_foreign_keys.spree.rb │ ├── 20180411082798_add_acceptance_status_errors_to_return_item.spree.rb │ ├── 20180411082799_create_spree_reimbursement_types.spree.rb │ ├── 20180411082800_add_default_to_shipment_cost.spree.rb │ ├── 20180411082801_add_default_to_spree_credit_cards.spree.rb │ ├── 20180411082802_make_existing_credit_cards_default.spree.rb │ ├── 20180411082803_add_type_to_reimbursement_type.spree.rb │ ├── 20180411082804_create_spree_reimbursement_credits.spree.rb │ ├── 20180411082805_add_meta_title_to_spree_products.spree.rb │ ├── 20180411082806_add_kind_to_zone.spree.rb │ ├── 20180411082807_add_code_to_spree_tax_categories.spree.rb │ ├── 20180411082808_default_pre_tax_amount_should_be_zero.spree.rb │ ├── 20180411082809_add_code_to_spree_shipping_methods.spree.rb │ ├── 20180411082810_add_cancel_audit_fields_to_spree_orders.spree.rb │ ├── 20180411082811_add_store_id_to_orders.spree.rb │ ├── 20180411082812_create_spree_taxons_prototypes.spree.rb │ ├── 20180411082813_add_state_lock_version_to_order.spree.rb │ ├── 20180411082814_add_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb │ ├── 20180411082815_fix_adjustment_order_presence.spree.rb │ ├── 20180411082816_update_classifications_positions.spree.rb │ ├── 20180411082817_add_guest_token_index_to_spree_orders.spree.rb │ ├── 20180411082818_remove_token_permissions_table.spree.rb │ ├── 20180411082819_remove_extra_products_slug_index.spree.rb │ ├── 20180411082820_update_product_slug_index.spree.rb │ ├── 20180411082821_rename_identifier_to_number_for_payment.spree.rb │ ├── 20180411082822_create_spree_store_credits.spree.rb │ ├── 20180411082823_create_spree_store_credit_categories.spree.rb │ ├── 20180411082824_create_spree_store_credit_events.spree.rb │ ├── 20180411082825_create_spree_store_credit_types.spree.rb │ ├── 20180411082826_remove_environment_from_payment_method.spree.rb │ ├── 20180411082827_add_resellable_to_return_items.spree.rb │ ├── 20180411082828_add_code_to_spree_promotion_categories.spree.rb │ ├── 20180411082829_remove_environment_from_tracker.spree.rb │ ├── 20180411082830_remove_spree_configurations.spree.rb │ ├── 20180411082831_add_index_to_spree_stock_items_variant_id.spree.rb │ ├── 20180411082832_ensure_payments_have_numbers.spree.rb │ ├── 20180411082833_add_missing_indexes_on_spree_tables.spree.rb │ ├── 20180411082834_remove_duplicated_indexes_from_multi_columns.spree.rb │ ├── 20180411082835_remove_user_index_from_spree_state_changes.spree.rb │ ├── 20180411082836_fix_adjustment_order_id.spree.rb │ ├── 20180411082837_add_position_to_spree_payment_methods.spree.rb │ ├── 20180411082838_add_deleted_at_to_friendly_id_slugs.spree.rb │ ├── 20180411082839_increase_scale_on_pre_tax_amounts.spree.rb │ ├── 20180411082840_add_taxable_adjustment_total_to_line_item.spree.rb │ ├── 20180411082841_migrate_payment_methods_display.spree.rb │ ├── 20180411082842_enable_acts_as_paranoid_on_calculators.spree.rb │ ├── 20180411082843_spree_payment_method_store_credits.spree.rb │ ├── 20180411082844_rename_has_and_belongs_to_associations_to_model_names.spree.rb │ ├── 20180411082845_spree_store_credit_types.spree.rb │ ├── 20180411082846_add_discontinued_to_products_and_variants.spree.rb │ ├── 20180411082847_remove_shipping_method_id_from_spree_orders.spree.rb │ ├── 20180411082848_add_id_column_to_earlier_habtm_tables.spree.rb │ ├── 20180411082849_add_indexes.spree.rb │ ├── 20180411082850_remove_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb │ ├── 20180411082851_acts_as_taggable_on_spree_migration.spree.rb │ ├── 20180411082852_change_collation_for_spree_tag_names.spree.rb │ ├── 20180411082853_add_missing_indexes_to_spree_taggings.spree.rb │ ├── 20180411082854_add_zipcode_required_to_spree_countries.spree.rb │ ├── 20180411082855_add_created_at_to_variant.spree.rb │ ├── 20180411082856_add_null_false_to_spree_variants_timestamps.spree.rb │ ├── 20180411082857_add_quantity_to_inventory_units.spree.rb │ ├── 20180411082858_add_original_return_item_id_to_spree_inventory_units.spree.rb │ ├── 20180411082859_add_unique_index_on_number_to_spree_orders.spree.rb │ ├── 20180411082860_add_unique_index_on_number_to_spree_stock_transfer.spree.rb │ ├── 20180411082861_add_unique_index_on_number_to_spree_shipment.spree.rb │ ├── 20180411082862_add_unique_index_on_number_to_spree_payments.spree.rb │ ├── 20180411082863_add_unique_index_on_number_to_spree_return_authorizations.spree.rb │ ├── 20180411082864_add_unique_index_on_number_to_spree_customer_returns.spree.rb │ ├── 20180411082865_add_unique_index_on_number_to_spree_reimbursements.spree.rb │ ├── 20180411082866_add_missing_unique_indexes_for_unique_attributes.spree.rb │ ├── 20180411082867_add_index_on_stock_location_to_spree_customer_returns.spree.rb │ ├── 20180411082868_add_index_on_prototype_to_spree_option_type_prototype.spree.rb │ ├── 20180411082869_add_indexes_to_spree_option_value_variant.spree.rb │ ├── 20180411082870_add_index_on_promotion_id_to_order_promotions.spree.rb │ ├── 20180411082871_add_indexes_for_property_prototype.spree.rb │ ├── 20180411082872_add_index_for_prototype_id_to_prototype_taxons.spree.rb │ ├── 20180411082873_add_indexes_to_refunds.spree.rb │ ├── 20180411082874_add_indexes_to_reimbursement_credits.spree.rb │ ├── 20180411082875_add_indexes_to_return_authorizations.spree.rb │ ├── 20180411082876_add_indexes_to_return_items.spree.rb │ ├── 20180411082877_add_index_to_role_users.spree.rb │ ├── 20180411082878_add_index_to_shipping_method_categories.spree.rb │ ├── 20180411082879_add_index_to_shipping_method_zones.spree.rb │ ├── 20180411082880_add_index_to_spree_shipping_rates.spree.rb │ ├── 20180411082881_add_index_to_spree_stock_items.spree.rb │ ├── 20180411082882_add_index_to_spree_stock_movement.spree.rb │ ├── 20180411082883_change_indexes_on_friendly_id_slugs.spree.rb │ ├── 20180411082884_add_analytics_kind_to_spree_trackers.spree.rb │ ├── 20180411082885_rename_tracker_kind_field.spree.rb │ ├── 20180411082886_add_api_key_to_spree_users.spree_api.rb │ ├── 20180411082887_resize_api_key_field.spree_api.rb │ ├── 20180411082888_rename_api_key_to_spree_api_key.spree_api.rb │ ├── 20180411082889_add_index_to_user_spree_api_key.spree_api.rb │ ├── 20180411082890_create_users.spree_auth.rb │ ├── 20180411082891_rename_columns_for_devise.spree_auth.rb │ ├── 20180411082892_convert_user_remember_field.spree_auth.rb │ ├── 20180411082893_add_reset_password_sent_at_to_spree_users.spree_auth.rb │ ├── 20180411082894_make_users_email_index_unique.spree_auth.rb │ ├── 20180411082895_add_deleted_at_to_users.spree_auth.rb │ ├── 20180411082896_add_confirmable_to_users.spree_auth.rb │ ├── 20180411082897_add_missing_indices_on_user.spree_auth.rb │ ├── 20180411082898_update_braintree_payment_method_type.spree_gateway.rb │ ├── 20180411082899_update_stripe_payment_method_type.spree_gateway.rb │ ├── 20180411082900_update_balanced_payment_method_type.spree_gateway.rb │ ├── 20180411082901_update_paypal_payment_method_type.spree_gateway.rb │ ├── 20180411082902_migrate_stripe_preferences.spree_gateway.rb │ ├── 20180416075149_create_identities.rb │ ├── 20180423194846_create_table_favorites.spree_favorite_products.rb │ ├── 20180423194847_rename_favorites_to_spree_favorites.spree_favorite_products.rb │ ├── 20180423194848_add_favorites_user_counts_to_product.spree_favorite_products.rb │ ├── 20180426104709_create_spree_folders.spree_digital_assets.rb │ ├── 20180426104710_create_spree_digital_assets.spree_digital_assets.rb │ ├── 20180426104711_add_digital_asset_id_to_spree_assets.spree_digital_assets.rb │ ├── 20180426104712_add_approved_boolean_to_digital_assets.spree_digital_assets.rb │ ├── 20180426184726_create_spree_permissions.spree_admin_roles_and_access.rb │ ├── 20180426184727_create_spree_roles_permissions.spree_admin_roles_and_access.rb │ ├── 20180426184728_add_editable_is_default_and_index_on_editable_is_default_and_name_to_spree_roles.spree_admin_roles_and_access.rb │ ├── 20180426184729_create_spree_permission_sets.spree_admin_roles_and_access.rb │ ├── 20180426184730_create_spree_roles_permission_sets.spree_admin_roles_and_access.rb │ ├── 20180426184731_create_spree_permissions_permission_sets.spree_admin_roles_and_access.rb │ ├── 20180426184732_add_description_to_permissions_and_permission_sets.spree_admin_roles_and_access.rb │ ├── 20180426184733_add_display_boolean_to_permission_sets.spree_admin_roles_and_access.rb │ ├── 20180426184734_deprecate_legacy_roles_and_permissions.spree_admin_roles_and_access.rb │ ├── 20180426184735_remove_column_boolean_from_permissions.spree_admin_roles_and_access.rb │ ├── 20180426184736_add_admin_boolean_to_roles.spree_admin_roles_and_access.rb │ ├── 20180518103103_create_ckeditor_assets.rb │ ├── 20180527112844_create_relation_types.spree_related_products.rb │ ├── 20180527112845_create_relations.spree_related_products.rb │ ├── 20180527112846_add_discount_to_relation.spree_related_products.rb │ ├── 20180527112847_prefixing_tables_with_spree.spree_related_products.rb │ ├── 20180527112848_update_relation_types.spree_related_products.rb │ ├── 20180527112849_update_relations.spree_related_products.rb │ ├── 20180527112850_add_position_to_spree_relations.spree_related_products.rb │ ├── 20180527130706_create_reviews.spree_reviews.rb │ ├── 20180527130707_create_feedback_reviews.spree_reviews.rb │ ├── 20180527130708_add_rating_to_products.spree_reviews.rb │ ├── 20180527130709_add_user_to_reviews.spree_reviews.rb │ ├── 20180527130710_add_ip_address_to_reviews.spree_reviews.rb │ ├── 20180527130711_namespace_tables.spree_reviews.rb │ ├── 20180527130712_recalculate_ratings.spree_reviews.rb │ ├── 20180527130713_add_locale_to_reviews.spree_reviews.rb │ ├── 20180527130714_add_locale_to_feedback_reviews.spree_reviews.rb │ ├── 20180527130715_add_show_identifier_to_reviews.spree_reviews.rb │ ├── 20180610043606_remove_indexes_from_spree_favorites.spree_favorite_products.rb │ ├── 20180610043607_add_polymorphic_fields_to_spree_favorites.spree_favorite_products.rb │ ├── 20180610043608_remove_product_id_from_spree_favorites.spree_favorite_products.rb │ ├── 20180610043609_add_favorites_user_count_to_variant.spree_favorite_products.rb │ ├── 20180614042445_remove_icon_from_taxons.spree.rb │ ├── 20180614042446_add_unique_index_on_spree_promotions_code.spree.rb │ ├── 20180615105321_create_active_storage_tables.active_storage.rb │ ├── 20180719070622_create_delivery_pincodes.rb │ ├── 20180801061208_create_spree_cart_events.spree_events_tracker.rb │ ├── 20180801061209_create_spree_page_events.spree_events_tracker.rb │ ├── 20180801061210_create_spree_checkout_events.spree_events_tracker.rb │ ├── 20180801061211_change_query_string_to_text.spree_events_tracker.rb │ ├── 20180801061212_change_referrer_to_text_from_string.spree_events_tracker.rb │ └── 20180801072719_create_spree_trackers.spree_analytics_trackers.rb ├── schema.rb └── seeds.rb ├── docker-compose.yml ├── lib ├── assets │ └── .keep └── tasks │ ├── .keep │ └── delivery_pincodes.rake ├── log └── .keep ├── new_setup.sh ├── package.json ├── public ├── 404.html ├── 422.html ├── 500.html ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── favicon.ico ├── robots.txt └── uploads │ └── shipment_pincodes.csv ├── routes ├── test ├── application_system_test_case.rb ├── controllers │ └── .keep ├── fixtures │ ├── .keep │ ├── delivery_pincodes.yml │ └── files │ │ └── .keep ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ └── delivery_pincode_test.rb ├── system │ └── .keep └── test_helper.rb ├── tmp └── .keep └── vendor └── assets ├── javascripts ├── .keep └── spree │ ├── backend │ └── all.js │ └── frontend │ └── all.js └── stylesheets ├── .keep └── spree ├── backend └── all.css └── frontend └── all.css /.docker/development.dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.3.4 2 | MAINTAINER pankaj@aviabird.com 3 | 4 | # update image 5 | RUN apt-get update -qq && apt-get install -y build-essential 6 | 7 | # for postgres 8 | RUN apt-get install -y libpq-dev 9 | 10 | # for a JS runtime 11 | RUN apt-get install -y nodejs 12 | 13 | 14 | ENV HOME=/home/app 15 | ENV APP_NAME=angularspree-server 16 | WORKDIR $HOME/$APP_NAME 17 | 18 | ADD Gemfile* $HOME/$APP_NAME/ 19 | 20 | # --- Add this to your Dockerfile --- 21 | ENV BUNDLE_GEMFILE=$HOME/$APP_NAME/Gemfile \ 22 | BUNDLE_JOBS=2 \ 23 | BUNDLE_PATH=/bundle 24 | 25 | RUN bundle install 26 | 27 | ADD . $HOME/$APP_NAME 28 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git* 2 | Dockerfile 3 | README.rdoc -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | GOOGLE_CLIENT_ID= 2 | GOOGLE_CLIENT_SECRET= 3 | STORAGE_SERVICE= 4 | RAILS_MASTER_KEY= 5 | FRONT_END_URL= 6 | PAYUBIZ_URL = 7 | CONTACT_NO= 8 | DATABASE_URL= 9 | -------------------------------------------------------------------------------- /.ruby-gemset: -------------------------------------------------------------------------------- 1 | angularspree-api 2 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.5.1 2 | -------------------------------------------------------------------------------- /.solargraph.yml: -------------------------------------------------------------------------------- 1 | --- 2 | include: 3 | - "**/*.rb" 4 | exclude: 5 | - spec/**/* 6 | - test/**/* 7 | - vendor/**/* 8 | - ".bundle/**/*" 9 | require: [] 10 | domains: [] 11 | reporters: 12 | - rubocop 13 | - require_not_found 14 | plugins: [] 15 | max_files: 5000 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | ## For setup follow these steps. 4 | 5 | * Install all dependencies `$ bundle install` 6 | * Run all migrations `$ rake db:migrate` 7 | * Load seed data `rake db:seed` 8 | * Load sample data `rake spree_sample:load` 9 | 10 | ## Demo 11 | 12 | Try with direct deployment on Heroku: 13 | 14 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/aviabird/angularspree-api) 15 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's 5 | // vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. JavaScript code in this file should be added after the last require_* statement. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require rails-ujs 14 | //= require activestorage 15 | //= require turbolinks 16 | //= require_tree . 17 | -------------------------------------------------------------------------------- /app/assets/javascripts/cable.js: -------------------------------------------------------------------------------- 1 | // Action Cable provides the framework to deal with WebSockets in Rails. 2 | // You can generate new channels where WebSocket features live using the `rails generate channel` command. 3 | // 4 | //= require action_cable 5 | //= require_self 6 | //= require_tree ./channels 7 | 8 | (function() { 9 | this.App || (this.App = {}); 10 | 11 | App.cable = ActionCable.createConsumer(); 12 | 13 | }).call(this); 14 | -------------------------------------------------------------------------------- /app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/app/assets/javascripts/channels/.keep -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's 6 | * vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/api/countries_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class CountriesController < BaseController 4 | def index 5 | @countries = Spree::Country.includes(:states).order(:name) 6 | 7 | render json: @countries, 8 | root: false, 9 | each_serializer: CountrySerializer 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/controllers/api/credit_cards_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class CreditCardsController < BaseController 4 | before_action :check_authorization 5 | 6 | def destroy 7 | authorize! :update, @user 8 | 9 | credit_card = @user.credit_cards.find params[:id] 10 | @user.drop_payment_source(credit_card) if credit_card 11 | 12 | respond_with credit_card 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/controllers/api/taxonomies_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class TaxonomiesController < ApplicationController 4 | def index 5 | @taxonomies = Spree::Taxonomy.order('name').includes(root: :children) 6 | 7 | render json: @taxonomies, 8 | each_serializer: TaxonomySerializer 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/controllers/api/taxons_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class TaxonsController < BaseController 4 | def show 5 | @taxon = Spree::Taxon.where(permalink: params[:permalink]).first! 6 | 7 | render json: @taxon, serializer: TaxonSerializer 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :null_session, prepend: true 5 | end 6 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/concerns/csrf.rb: -------------------------------------------------------------------------------- 1 | module Csrf 2 | extend ActiveSupport::Concern 3 | 4 | included do 5 | protect_from_forgery 6 | 7 | after_filter :set_csrf_cookie 8 | end 9 | 10 | protected 11 | 12 | def set_csrf_cookie 13 | cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery? 14 | end 15 | 16 | def verified_request? 17 | super || form_authenticity_token == request.headers['X-XSRF-TOKEN'] 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /app/controllers/oauth_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class OauthController < BaseController 4 | def create 5 | auth = Oauth.for(params[:provider]).new(params).call 6 | if auth.authorized? 7 | user = OauthUserCreator.new(auth.user_info, set_current_user).call 8 | 9 | @current_spree_user = user 10 | set_current_order 11 | 12 | if user 13 | render json: user, 14 | root: false, 15 | scope: user, 16 | serializer: LiteUserSerializer 17 | else 18 | render json: { error: "Error linking #{params[:provider]} account" }, status: 422 19 | end 20 | else 21 | render json: { error: "There was an error with #{params['provider']}. please try again." }, status: 422 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /app/controllers/spree/api/base_controller_decorator.rb: -------------------------------------------------------------------------------- 1 | Spree::Api::BaseController.class_eval do 2 | def api_key 3 | request.headers['Auth-Token'] || params[:token] 4 | end 5 | helper_method :api_key 6 | 7 | def order_token 8 | request.headers['Order-Token'] || params[:order_token] 9 | end 10 | 11 | def load_user 12 | return nil if api_key.blank? 13 | @current_api_user = Spree.user_class.find_by(spree_api_key: api_key.to_s) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/app/mailers/.keep -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: ENV['MAIL_FROM'] 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /app/mailers/base_mailer.rb: -------------------------------------------------------------------------------- 1 | class BaseMailer < ApplicationMailer 2 | 3 | end -------------------------------------------------------------------------------- /app/mailers/user_mailer.rb: -------------------------------------------------------------------------------- 1 | class UserMailer < ActionMailer::Base 2 | 3 | def reset_password_instructions(user, token) 4 | @user = user 5 | @token =token 6 | mail(to: @user.email, subject: 'Reset Password Instructions') 7 | end 8 | 9 | def user_registration_instructions(user) 10 | @user = user 11 | mail(to: @user.email, subject: "Welcome to #{ENV['APP_NAME']}") 12 | end 13 | end -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/app/models/.keep -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/ckeditor/asset.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Asset < ActiveRecord::Base 2 | include Ckeditor::Orm::ActiveRecord::AssetBase 3 | include Ckeditor::Backend::Paperclip 4 | end 5 | -------------------------------------------------------------------------------- /app/models/ckeditor/attachment_file.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::AttachmentFile < Ckeditor::Asset 2 | has_attached_file :data, 3 | url: '/ckeditor_assets/attachments/:id/:filename', 4 | path: ':rails_root/public/ckeditor_assets/attachments/:id/:filename' 5 | 6 | validates_attachment_presence :data 7 | validates_attachment_size :data, less_than: 100.megabytes 8 | do_not_validate_attachment_file_type :data 9 | 10 | def url_thumb 11 | @url_thumb ||= Ckeditor::Utils.filethumb(filename) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/models/ckeditor/picture.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Picture < Ckeditor::Asset 2 | has_attached_file :data, 3 | url: '/ckeditor_assets/pictures/:id/:style_:basename.:extension', 4 | path: ':rails_root/public/ckeditor_assets/pictures/:id/:style_:basename.:extension', 5 | styles: { content: '800>', thumb: '118x100#' } 6 | 7 | validates_attachment_presence :data 8 | validates_attachment_size :data, less_than: 2.megabytes 9 | validates_attachment_content_type :data, content_type: /\Aimage/ 10 | 11 | def url_content 12 | url(:content) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/delivery_pincode.rb: -------------------------------------------------------------------------------- 1 | class DeliveryPincode < ApplicationRecord 2 | end 3 | -------------------------------------------------------------------------------- /app/models/identity.rb: -------------------------------------------------------------------------------- 1 | class Identity < ActiveRecord::Base 2 | validates_presence_of :user, 3 | :provider, 4 | :uid 5 | belongs_to :user, class_name: 'Spree::User' 6 | 7 | def google? 8 | provider == 'google' 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/models/spree/image_decorator.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Spree::Image.class_eval do 4 | include Rails.application.routes.url_helpers 5 | 6 | def styles 7 | self.class.styles.map do |_, size| 8 | width, height = size[/(\d+)x(\d+)/].split('x') 9 | 10 | { 11 | url: polymorphic_path( 12 | attachment.variant(resize: size, strip: true), 13 | only_path: true 14 | ), 15 | width: width, 16 | height: height 17 | } 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/models/spree/payment_method/payubiz.rb: -------------------------------------------------------------------------------- 1 | module Spree 2 | class PaymentMethod::Payubiz < PaymentMethod 3 | def source_required? 4 | false 5 | end 6 | end 7 | end -------------------------------------------------------------------------------- /app/monkey_patch/file_decorator.rb: -------------------------------------------------------------------------------- 1 | File.class_eval do 2 | def self.open(*args) 3 | if args[0].is_a?(StringIO) 4 | begin 5 | string = args[0] 6 | tmp = Tempfile.new 7 | tmp.binmode 8 | tmp.write string.read 9 | tmp.rewind 10 | args[0] = tmp 11 | string.rewind 12 | rescue StandardError 13 | end 14 | end 15 | 16 | file = super(*args) 17 | file 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/serializers/address_serializer.rb: -------------------------------------------------------------------------------- 1 | class AddressSerializer < BaseSerializer 2 | attributes *address_attributes 3 | 4 | has_one :country, serializer: CountrySerializer 5 | has_one :state, serializer: StateSerializer 6 | end -------------------------------------------------------------------------------- /app/serializers/adjustement_serializer.rb: -------------------------------------------------------------------------------- 1 | class AdjustmentSerializer < BaseSerializer 2 | attributes :id, :source_type, :source_id, :adjustable_type, :adjustable_id, 3 | :amount, :label, :mandatory, 4 | :included, :eligible, :display_amount 5 | end -------------------------------------------------------------------------------- /app/serializers/adjustment_serializer.rb: -------------------------------------------------------------------------------- 1 | class AdjustmentSerializer < BaseSerializer 2 | attributes :id, :source_type, :source_id, :adjustable_type, :adjustable_id, 3 | :amount, :label, :mandatory, 4 | :included, :eligible, :display_amount 5 | end -------------------------------------------------------------------------------- /app/serializers/base_serializer.rb: -------------------------------------------------------------------------------- 1 | require "active_model_serializers" 2 | 3 | class BaseSerializer < ActiveModel::Serializer 4 | extend Spree::Api::ApiHelpers 5 | # cached 6 | # delegate :cache_key, to: :object 7 | end 8 | -------------------------------------------------------------------------------- /app/serializers/classification_serializer.rb: -------------------------------------------------------------------------------- 1 | class ClassificationSerializer < BaseSerializer 2 | attributes :taxon_id, :position 3 | 4 | has_one :taxon, embed: :objects, serializer: TaxonSerializer 5 | end -------------------------------------------------------------------------------- /app/serializers/country_serializer.rb: -------------------------------------------------------------------------------- 1 | class CountrySerializer < BaseSerializer 2 | attributes *(country_attributes | [:states_required]) 3 | 4 | has_many :states, serializer: StateSerializer 5 | end -------------------------------------------------------------------------------- /app/serializers/image_serializer.rb: -------------------------------------------------------------------------------- 1 | class ImageSerializer < BaseSerializer 2 | attributes :id, :position, :attachment_content_type, :attachment_file_name, 3 | :type, :attachment_updated_at, :attachment_width, 4 | :attachment_height, :alt, :viewable_type, :viewable_id 5 | 6 | def attributes 7 | super.tap do |attrs| 8 | image_styles.each_key do |style| 9 | attrs["#{style}_url"] = object.attachment.url(style) 10 | end 11 | end 12 | end 13 | 14 | private 15 | 16 | def image_styles 17 | Spree::Image.attachment_definitions[:attachment][:styles] 18 | end 19 | end -------------------------------------------------------------------------------- /app/serializers/line_item_serializer.rb: -------------------------------------------------------------------------------- 1 | class LineItemSerializer < BaseSerializer 2 | attributes *line_item_attributes 3 | attributes :single_display_amount, :display_amount, :total 4 | 5 | has_many :adjustments, serializer: AdjustmentSerializer 6 | has_one :variant, serializer: SmallVariantSerializer 7 | end -------------------------------------------------------------------------------- /app/serializers/lite_line_item_serializer.rb: -------------------------------------------------------------------------------- 1 | class LiteLineItemSerializer < BaseSerializer 2 | attributes :single_display_amount, :display_amount, :total, :image_url 3 | 4 | def image_url 5 | object.variant.images.first.attachment.url('small') 6 | end 7 | end -------------------------------------------------------------------------------- /app/serializers/lite_order_serializer.rb: -------------------------------------------------------------------------------- 1 | class LiteOrderSerializer < BaseSerializer 2 | attributes( 3 | :number, :payment_state, :completed_at, :state, :total, 4 | :shipment_state, :created_at, :updated_at, :currency, :line_items 5 | ) 6 | 7 | has_many :line_items, serializer: LiteLineItemSerializer 8 | 9 | end -------------------------------------------------------------------------------- /app/serializers/lite_user_serializer.rb: -------------------------------------------------------------------------------- 1 | class LiteUserSerializer < BaseSerializer 2 | # attributes *user_attributes 3 | # Correct this implementaion by overriding user_attributes 4 | # rather than redefining 5 | attributes :id, :email, :created_at, :updated_at, :spree_api_key 6 | end 7 | -------------------------------------------------------------------------------- /app/serializers/option_type_serializer.rb: -------------------------------------------------------------------------------- 1 | class OptionTypeSerializer < BaseSerializer 2 | attributes :id, :name, :presentation, :position 3 | end -------------------------------------------------------------------------------- /app/serializers/option_value_serializer.rb: -------------------------------------------------------------------------------- 1 | class OptionValueSerializer < BaseSerializer 2 | attributes :id, :name, :presentation, :option_type_name, :option_type_id, 3 | :option_type_presentation, :position 4 | end -------------------------------------------------------------------------------- /app/serializers/payment_method_serializer.rb: -------------------------------------------------------------------------------- 1 | class PaymentMethodSerializer < BaseSerializer 2 | attributes :id, :name, :environment 3 | end -------------------------------------------------------------------------------- /app/serializers/payment_serializer.rb: -------------------------------------------------------------------------------- 1 | class PaymentSerializer < BaseSerializer 2 | attributes :id, :source_type, :source_id, :amount, :display_amount, 3 | :payment_method_id, :response_code, :state, :avs_response, 4 | :created_at, :updated_at 5 | 6 | has_one :payment_method, serializer: PaymentMethodSerializer 7 | has_one :source, serializer: PaymentSourceSerializer 8 | end -------------------------------------------------------------------------------- /app/serializers/product_property_serializer.rb: -------------------------------------------------------------------------------- 1 | class ProductPropertySerializer < BaseSerializer 2 | attributes :id, :product_id, :property_id, :value, :property_name 3 | end -------------------------------------------------------------------------------- /app/serializers/shipping_category_serializer.rb: -------------------------------------------------------------------------------- 1 | class ShippingCategorySerializer < BaseSerializer 2 | attributes :id, :name 3 | end -------------------------------------------------------------------------------- /app/serializers/shipping_method_serializer.rb: -------------------------------------------------------------------------------- 1 | class ShippingMethodSerializer < BaseSerializer 2 | attributes :id, :code, :name 3 | 4 | has_many :shipping_categories, 5 | serializer: ShippingCategorySerializer 6 | has_many :zones, serializer: ZoneSerializer 7 | end -------------------------------------------------------------------------------- /app/serializers/shipping_rate_serializer.rb: -------------------------------------------------------------------------------- 1 | class ShippingRateSerializer < BaseSerializer 2 | attributes :id, :name, :cost, :selected, :shipping_method_id, 3 | :shipping_method_code, :display_cost 4 | end -------------------------------------------------------------------------------- /app/serializers/state_serializer.rb: -------------------------------------------------------------------------------- 1 | class StateSerializer < BaseSerializer 2 | attributes *state_attributes 3 | end -------------------------------------------------------------------------------- /app/serializers/taxon_serializer.rb: -------------------------------------------------------------------------------- 1 | class TaxonSerializer < BaseSerializer 2 | attributes *taxon_attributes 3 | 4 | has_many :children, key: :taxons, serializer: self 5 | end -------------------------------------------------------------------------------- /app/serializers/taxonomy_serializer.rb: -------------------------------------------------------------------------------- 1 | class TaxonomySerializer < BaseSerializer 2 | attributes *taxonomy_attributes 3 | 4 | has_one :root, embed: :objects, 5 | serializer: TaxonSerializer 6 | end -------------------------------------------------------------------------------- /app/serializers/user_serializer.rb: -------------------------------------------------------------------------------- 1 | class UserSerializer < BaseSerializer 2 | attributes *(user_attributes | [:bill_address_id, :ship_address_id]) 3 | 4 | # has_many :addresses, serializer: AddressSerializer 5 | has_many :payment_sources, serializer: PaymentSourceSerializer 6 | has_one :bill_address, serializer: AddressSerializer 7 | has_one :ship_address, serializer: AddressSerializer 8 | 9 | def payment_sources 10 | object.credit_cards 11 | end 12 | end -------------------------------------------------------------------------------- /app/serializers/zone_serializer.rb: -------------------------------------------------------------------------------- 1 | class ZoneSerializer < BaseSerializer 2 | attributes :id, :name, :description 3 | end -------------------------------------------------------------------------------- /app/services/oauth.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Oauth 4 | PROVIDERS = { 5 | google: Oauth::Google 6 | }.freeze 7 | 8 | class OauthError < StandardError; end 9 | class OauthProviderNotImplemented < OauthError; end 10 | class MissingTokenError < OauthError; end 11 | class ResponseError < OauthError; end 12 | 13 | def self.for(provider) 14 | PROVIDERS.fetch(provider.to_sym) { raise OauthProviderNotImplemented } 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/services/oauth/google.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Oauth 4 | class Google < Oauth::Base 5 | def fetch_user_info 6 | response = _client.get(user_info_url, access_token: @access_token) 7 | @user_info = Oauth::UserInfo::Google.new(JSON.parse(response.body)) 8 | end 9 | 10 | private 11 | 12 | def access_token_url 13 | 'https://www.googleapis.com/oauth2/v3/token' 14 | end 15 | 16 | def user_info_url 17 | 'https://www.googleapis.com/plus/v1/people/me/openIdConnect' 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/services/oauth/user_info.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Oauth 4 | module UserInfo 5 | class Base 6 | def initialize(info = {}) 7 | @info = info 8 | end 9 | 10 | def uid; end 11 | 12 | def email; end 13 | 14 | def email_verified?; end 15 | end 16 | 17 | class Google < Base 18 | def uid 19 | @info.fetch('sub') 20 | end 21 | 22 | def email 23 | @info.fetch('email') 24 | end 25 | 26 | def email_verified? 27 | @info.fetch('email_verified') 28 | end 29 | 30 | def provider 31 | 'google' 32 | end 33 | end 34 | 35 | class Facebook < Base 36 | def provider 37 | 'facebook' 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/views/kaminari/_first_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link to the "First" page 2 | - available local variables 3 | url: url to the first page 4 | current_page: a page object for the currently displayed page 5 | total_pages: total number of pages 6 | per_page: number of items to fetch per page 7 | remote: data-remote 8 | -%> 9 |
  • 10 | <%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote %> 11 |
  • 12 | -------------------------------------------------------------------------------- /app/views/kaminari/_gap.html.erb: -------------------------------------------------------------------------------- 1 | <%# Non-link tag that stands for skipped pages... 2 | - available local variables 3 | current_page: a page object for the currently displayed page 4 | total_pages: total number of pages 5 | per_page: number of items to fetch per page 6 | remote: data-remote 7 | -%> 8 |
  • ..
  • 9 | -------------------------------------------------------------------------------- /app/views/kaminari/_last_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link to the "Last" page 2 | - available local variables 3 | url: url to the last page 4 | current_page: a page object for the currently displayed page 5 | total_pages: total number of pages 6 | per_page: number of items to fetch per page 7 | remote: data-remote 8 | -%> 9 |
  • 10 | <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, remote: remote %> 11 |
  • 12 | -------------------------------------------------------------------------------- /app/views/kaminari/_next_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link to the "Next" page 2 | - available local variables 3 | url: url to the next page 4 | current_page: a page object for the currently displayed page 5 | total_pages: total number of pages 6 | per_page: number of items to fetch per page 7 | remote: data-remote 8 | -%> 9 | 16 | -------------------------------------------------------------------------------- /app/views/kaminari/_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link showing page number 2 | - available local variables 3 | page: a page object for "this" page 4 | url: url to this page 5 | current_page: a page object for the currently displayed page 6 | total_pages: total number of pages 7 | per_page: number of items to fetch per page 8 | remote: data-remote 9 | -%> 10 |
  • 11 | <%= link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} %> 12 |
  • 13 | -------------------------------------------------------------------------------- /app/views/kaminari/_prev_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link to the "Previous" page 2 | - available local variables 3 | url: url to the previous page 4 | current_page: a page object for the currently displayed page 5 | total_pages: total number of pages 6 | per_page: number of items to fetch per page 7 | remote: data-remote 8 | -%> 9 | 16 | -------------------------------------------------------------------------------- /app/views/kaminari/twitter-bootstrap-3/_first_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link to the "First" page 2 | - available local variables 3 | url: url to the first page 4 | current_page: a page object for the currently displayed page 5 | total_pages: total number of pages 6 | per_page: number of items to fetch per page 7 | remote: data-remote 8 | -%> 9 | <% unless current_page.first? %> 10 |
  • 11 | <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote %> 12 |
  • 13 | <% end %> 14 | -------------------------------------------------------------------------------- /app/views/kaminari/twitter-bootstrap-3/_gap.html.erb: -------------------------------------------------------------------------------- 1 | <%# Non-link tag that stands for skipped pages... 2 | - available local variables 3 | current_page: a page object for the currently displayed page 4 | total_pages: total number of pages 5 | per_page: number of items to fetch per page 6 | remote: data-remote 7 | -%> 8 |
  • <%= raw(t 'views.pagination.truncate') %>
  • -------------------------------------------------------------------------------- /app/views/kaminari/twitter-bootstrap-3/_last_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link to the "Last" page 2 | - available local variables 3 | url: url to the last page 4 | current_page: a page object for the currently displayed page 5 | total_pages: total number of pages 6 | per_page: number of items to fetch per page 7 | remote: data-remote 8 | -%> 9 | <% unless current_page.last? %> 10 | 13 | <% end %> 14 | -------------------------------------------------------------------------------- /app/views/kaminari/twitter-bootstrap-3/_next_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link to the "Next" page 2 | - available local variables 3 | url: url to the next page 4 | current_page: a page object for the currently displayed page 5 | total_pages: total number of pages 6 | per_page: number of items to fetch per page 7 | remote: data-remote 8 | -%> 9 | <% unless current_page.last? %> 10 |
  • 11 | <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote %> 12 |
  • 13 | <% end %> 14 | -------------------------------------------------------------------------------- /app/views/kaminari/twitter-bootstrap-3/_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link showing page number 2 | - available local variables 3 | page: a page object for "this" page 4 | url: url to this page 5 | current_page: a page object for the currently displayed page 6 | total_pages: total number of pages 7 | per_page: number of items to fetch per page 8 | remote: data-remote 9 | -%> 10 |
  • 11 | <%= link_to page, url, opts = {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil} %> 12 |
  • 13 | -------------------------------------------------------------------------------- /app/views/kaminari/twitter-bootstrap-3/_prev_page.html.erb: -------------------------------------------------------------------------------- 1 | <%# Link to the "Previous" page 2 | - available local variables 3 | url: url to the previous page 4 | current_page: a page object for the currently displayed page 5 | total_pages: total number of pages 6 | per_page: number of items to fetch per page 7 | remote: data-remote 8 | -%> 9 | <% unless current_page.first? %> 10 | 13 | <% end %> 14 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Angspree 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/spree/admin/invoice/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/views/spree/admin/invoice/_header.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 |
    <%= image_tag Spree::HtmlInvoice::Config[:html_invoice_logo_path] || "store/invoice_logo.jpg", id: "logo",style: 'height:80%;width:auto;' %> 5 |
    6 |

    <%= Spree.t("#{params[:template]}.header") %>

    7 |

    <%= Spree.t(:order_number, number: @order.number) %>

    8 |

    <%=Spree.t(:order_date) %>: <%= Spree.l(@order.completed_at.to_date) if @order.completed_at %>

    9 |
    -------------------------------------------------------------------------------- /app/views/spree/api/v1/images/show.v1.rabl: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | object @image 4 | attributes(*image_attributes) 5 | attributes :viewable_type, :viewable_id 6 | Spree::Image.styles.each do |k, v| 7 | node("#{k}_url") do |i| 8 | main_app.url_for( 9 | i.attachment.variant(resize: v, strip: true) 10 | ) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/orders/index.v1.rabl: -------------------------------------------------------------------------------- 1 | object false 2 | if request.headers['ng-api'] == 'true' 3 | extends 'spree/api/v1/orders/ng_index' 4 | else 5 | child(@orders => :orders) do 6 | extends 'spree/api/v1/orders/order' 7 | end 8 | node(:count) { @orders.count } 9 | node(:current_page) { params[:page].try(:to_i) || 1 } 10 | node(:pages) { @orders.total_pages } 11 | node(:per_page) { params[:per_page].try(:to_i) || Kaminari.config.default_per_page } 12 | node(:total_count) {@orders.total_count} 13 | end 14 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/orders/mine.v1.rabl: -------------------------------------------------------------------------------- 1 | object false 2 | if request.headers['ng-api'] == 'true' 3 | extends 'spree/api/v1/orders/ng_mine' 4 | else 5 | child(@orders => :orders) do 6 | extends 'spree/api/v1/orders/show' 7 | end 8 | 9 | node(:count) { @orders.count } 10 | node(:current_page) { params[:page].try(:to_i) || 1 } 11 | node(:pages) { @orders.total_pages } 12 | node(:total_count) {@orders.total_count} 13 | node(:per_page) { params[:per_page].try(:to_i) || Kaminari.config.default_per_page } 14 | end -------------------------------------------------------------------------------- /app/views/spree/api/v1/orders/ng_index.v1.rabl: -------------------------------------------------------------------------------- 1 | object false 2 | child(@orders => :orders) do 3 | extends 'spree/api/v1/orders/order' 4 | end 5 | 6 | node(:count) { @orders.count } 7 | node(:current_page) { params[:page].try(:to_i) || 1 } 8 | node(:pages) { @orders.total_pages } 9 | node(:per_page) { params[:per_page].try(:to_i) || Kaminari.config.default_per_page } 10 | node(:total_count) {@orders.total_count} -------------------------------------------------------------------------------- /app/views/spree/api/v1/orders/ng_mine.v1.rabl: -------------------------------------------------------------------------------- 1 | object false 2 | child(@orders => :orders) do 3 | extends 'spree/api/v1/orders/show' 4 | end 5 | 6 | node(:count) { @orders.count } 7 | node(:current_page) { params[:page].try(:to_i) || 1 } 8 | node(:pages) { @orders.total_pages } 9 | node(:total_count) {@orders.total_count} 10 | node(:per_page) { params[:per_page].try(:to_i) || Kaminari.config.default_per_page } 11 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/products/index.v1.rabl: -------------------------------------------------------------------------------- 1 | object false 2 | 3 | if request.headers['ng-api'] == 'true' 4 | extends 'spree/api/v1/products/ng_index' 5 | else 6 | node(:count) { @products.count } 7 | node(:total_count) { @products.total_count } 8 | node(:current_page) { params[:page] ? params[:page].to_i : 1 } 9 | node(:per_page) { params[:per_page].try(:to_i) || Kaminari.config.default_per_page } 10 | node(:pages) { @products.total_pages } 11 | child(@products => :products) do 12 | extends 'spree/api/v1/products/show' 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/products/ng_classification.v1.rabl: -------------------------------------------------------------------------------- 1 | attributes :taxon_id, :position 2 | 3 | child(:taxon) do 4 | extends 'spree/api/v1/taxons/show' 5 | end 6 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/products/ng_index.v1.rabl: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | object false 4 | 5 | child(root: :pagination) do 6 | node(:count) { @products.count } 7 | node(:total_count) { @products.total_count } 8 | node(:current_page) { params[:page] ? params[:page].to_i : 1 } 9 | node(:per_page) { params[:per_page].try(:to_i) || Kaminari.config.default_per_page } 10 | node(:pages) { @products.total_pages } 11 | end 12 | 13 | child(@products => :data) do 14 | extends 'spree/api/v1/products/ng_show' 15 | end 16 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/products/ng_large_show.v1.rabl: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | attributes *product_attributes 4 | node(:price) { |p| p.price } 5 | node(:currency) { current_currency } 6 | node(:currency_symbol) { Money::Currency.table[current_currency.underscore.to_sym][:symbol] } 7 | node(:has_variants, &:has_variants?) 8 | node(:taxon_ids, &:taxon_ids) 9 | node(:cost_price) { |p| p.cost_price.to_s } 10 | 11 | # check whether the product is favorited by current user 12 | node :is_favorited_by_current_user do |p| 13 | @current_api_user ? @current_api_user.favorite_products.ids.include?(p.id) : false 14 | end 15 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/products/ng_option_type.v1.rabl: -------------------------------------------------------------------------------- 1 | attributes(*option_type_attributes) 2 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/products/ng_product_property.v1.rabl: -------------------------------------------------------------------------------- 1 | attributes(*product_property_attributes) 2 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/products/ng_small_show.v1.rabl: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | attributes(:slug, :name) 4 | 5 | node(:product_url) do |p| 6 | image = p.master.images.first 7 | image && 8 | main_app.url_for( 9 | image.attachment.variant(resize: '200x200', strip: true) 10 | ) 11 | end 12 | 13 | node(:price, &:price) 14 | node(:cost_price) { |p| p.master.cost_price.to_s } 15 | node(:avg_rating, &:avg_rating) 16 | node(:reviews_count, &:reviews_count) 17 | node(:currency) { current_currency } 18 | node(:currency_symbol) do 19 | Money::Currency.table[current_currency.underscore.to_sym][:symbol] 20 | end 21 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/taxonomies/nested.v1.rabl: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | attributes(*taxonomy_attributes) 4 | 5 | child root: :root do 6 | attributes(*taxon_attributes) 7 | 8 | child children: :taxons do 9 | node(:icon) { |p| p.icon&.attachment && main_app.url_for(p.icon&.attachment) } 10 | attributes(*taxon_attributes) 11 | extends 'spree/api/v1/taxons/taxons' 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/taxons/taxons.v1.rabl: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | attributes(*taxon_attributes) 4 | 5 | node :taxons do |t| 6 | t.children.map do |c| 7 | partial('spree/api/v1/taxons/taxons', object: c) 8 | .merge(icon: c.icon&.attachment && main_app.url_for(c.icon&.attachment)) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/users/show.v1.rabl: -------------------------------------------------------------------------------- 1 | object @user 2 | 3 | attributes *user_attributes 4 | child(bill_address: :bill_address) do 5 | extends 'spree/api/v1/addresses/show' 6 | end 7 | 8 | child(ship_address: :ship_address) do 9 | extends 'spree/api/v1/addresses/show' 10 | end 11 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/variants/ng_option_value.v1.rabl: -------------------------------------------------------------------------------- 1 | attributes(*option_value_attributes) 2 | -------------------------------------------------------------------------------- /app/views/spree/api/v1/variants/ng_small_attrs.v1.rabl: -------------------------------------------------------------------------------- 1 | attributes *variant_attributes 2 | 3 | node(:display_price) { |p| p.display_price.to_s } 4 | node(:options_text, &:options_text) 5 | node(:track_inventory, &:should_track_inventory?) 6 | node(:in_stock, &:in_stock?) 7 | node(:is_backorderable, &:is_backorderable?) 8 | node(:is_orderable) { |v| v.is_backorderable? || v.in_stock? } 9 | node(:total_on_hand, &:total_on_hand) 10 | node(:is_destroyed, &:destroyed?) 11 | node(:cost_price) { |p| p.cost_price.to_s } 12 | 13 | -------------------------------------------------------------------------------- /app/views/user_mailer/reset_password_instructions.html.erb: -------------------------------------------------------------------------------- 1 |

    Hello <%= @user.email %>!

    2 | 3 |

    A request to reset your password has been made from <%= ENV['FRONT_END_URL']%>. 4 | If you did not make this request, simply ignore this email. 5 | 6 | If you did make this request just click the link below:

    7 | 8 |

    <%= link_to 'Change My Password Link', "#{ENV['FRONT_END_URL']}/auth/updatePassword?reset_password_token=#{@token}&email=#{@user.email}&id=#{@user.id}"%> 9 |

    10 | 11 |

    Your password won't change until you access the link above and create a new one.

    12 | -------------------------------------------------------------------------------- /app/views/user_mailer/reset_password_instructions.text.erb: -------------------------------------------------------------------------------- 1 | Hi <%=@user.email%> 2 | Sample mail sent using smtp. -------------------------------------------------------------------------------- /app/views/user_mailer/user_registration_instructions.erb: -------------------------------------------------------------------------------- 1 |

    Hello <%= @user.email %>!

    2 |

    Congratulations! You have successfully created a new account with <%= ENV['APP_NAME']%>.

    3 |
    4 |

    Your Login email is: <%= @user.email %>

    5 |
    6 |

    In case you have questions or need further assistance, call us on <%= ENV['APP_CONTACT_NUMBER'] %>.

    7 |

    We are avialable 24 hours a day, 7 days a week.

    8 |
    9 |

    Happy Shopping!

    10 |
    11 |

    The <%= ENV['APP_NAME']%> team

    12 | -------------------------------------------------------------------------------- /app/views/user_mailer/user_registration_instructions.text.erb: -------------------------------------------------------------------------------- 1 | Hello <%= @user.email %>! 2 | 3 | Congratulations! You have successfully created a new account with <%= ENV['APP_NAME']%>. 4 | Your Login email is: <%= @user.email %> 5 | In case you have questions or need further assistance, call us on <%= ENV['APP_CONTACT_NUMBER'] %>. 6 | We are avialable 24 hours a day, 7 days a week. 7 | 8 | Happy Shopping! 9 | 10 | The <%= ENV['APP_NAME']%> team 11 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../config/application', __dir__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | begin 5 | exec "yarnpkg", *ARGV 6 | rescue Errno::ENOENT 7 | $stderr.puts "Yarn executable was not detected in the system." 8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 9 | exit 1 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: angularspree-api_production 11 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | Jgc2tSHM8iGn1uxUYEEkI3Yd21AyRTwqB9Tp1FsGNFYfh0w8VB8QLkDPhW0EwJR8KREf9nyigeCbn21jep5SlzmUaDR63TnuQNytxw3N3tlPOtw3wv1Ycyn18eDYDl+fzOscngXxpIv72/4+fzla+sw2WXrPdj1DW4uuqVD0P548hC2ZFZYb0ksqui5wNODIn0I7orrA9kqmTfDyi7GgMTqF4NW9wSsCoapaptVkLlkOZWGaDNix58cTkNjeVUjAAiO0dSUNUJWIhfbNEiKAEyUu6htLTGL4nnsUZnpTny8qkqWvrEhYpMWtsVQ+vjSJQAZkqNR0Z2Kq7nfO1gEMAjW+Q1sbPEmAHolwHW9BrulX5iw4XHnyBBRYMIYa85bUmnvkhCTQOV3fQgm2Dt1mj1NHaVChGFE2NcU+0O0c5qr3Cpk7uKtrcHTeSAP0YiK44iZJuipRhdNwaqmvcCtS5GUCFwFORro1BuWRgaNvsiGFSevndVWDgzAu+lUaDqPGzupRtpyFJsIbGynessetNQz1JvPFFEPoO3A0g/s=--sP93cCDz4DLcUTTg--z2PNRiEezDBwBZ3Iik0kNA== -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | adapter: postgresql 3 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 20 } %> 4 | timeout: 5000 5 | 6 | development: 7 | <<: *default 8 | database: angularspree_dev 9 | 10 | # Warning: The database defined as "test" will be erased and 11 | # re-generated from your development database when you run "rake". 12 | # Do not set this db to the same as development or production. 13 | test: 14 | <<: *default 15 | database: angularspree_test 16 | 17 | production: 18 | adapter: postgresql 19 | pool: 10 20 | timeout: 5000 21 | database: <%= ENV.fetch("DATABASE_URL") { 20 } %> 22 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /config/initializers/devise.rb: -------------------------------------------------------------------------------- 1 | Devise.secret_key = "ca4dd925c621e74e4789fc307e24b279bbdcca48641da75bc0facbb42d356a914f65b54665f74aff83dd22de21d4dfd5398c" -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/rabl_init.rb: -------------------------------------------------------------------------------- 1 | require 'rabl' 2 | require 'oj' 3 | 4 | Rabl.configure do |config| 5 | config.json_engine = Oj 6 | end 7 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_angularspree_session' 4 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | %w[ 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ].each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082629_add_tax_rate_label.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20120905145253) 2 | class AddTaxRateLabel < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_tax_rates, :name, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082630_add_toggle_tax_rate_display.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20120905151823) 2 | class AddToggleTaxRateDisplay < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_tax_rates, :show_rate_in_label, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082631_remove_unused_preference_columns.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20120929093553) 2 | class RemoveUnusedPreferenceColumns < ActiveRecord::Migration[4.2] 3 | def change 4 | # Columns have already been removed if the application was upgraded from an older version, but must be removed from new apps. 5 | remove_column :spree_preferences, :name if ApplicationRecord.connection.column_exists?(:spree_preferences, :name) 6 | remove_column :spree_preferences, :owner_id if ApplicationRecord.connection.column_exists?(:spree_preferences, :owner_id) 7 | remove_column :spree_preferences, :owner_type if ApplicationRecord.connection.column_exists?(:spree_preferences, :owner_type) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082632_add_lock_version_to_variant.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121009142519) 2 | class AddLockVersionToVariant < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_variants, :lock_version, :integer, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082633_add_states_required_to_countries.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121010142909) 2 | class AddStatesRequiredToCountries < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_countries, :states_required, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082634_add_on_demand_to_product_and_variant.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121012071449) 2 | class AddOnDemandToProductAndVariant < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_products, :on_demand, :boolean, default: false 5 | add_column :spree_variants, :on_demand, :boolean, default: false 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082635_remove_not_null_constraint_from_products_on_hand.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121017010007) 2 | class RemoveNotNullConstraintFromProductsOnHand < ActiveRecord::Migration[4.2] 3 | def up 4 | change_column :spree_products, :count_on_hand, :integer, null: true 5 | change_column :spree_variants, :count_on_hand, :integer, null: true 6 | end 7 | 8 | def down 9 | change_column :spree_products, :count_on_hand, :integer, null: false 10 | change_column :spree_variants, :count_on_hand, :integer, null: false 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082637_remove_not_null_from_spree_prices_amount.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121107003422) 2 | class RemoveNotNullFromSpreePricesAmount < ActiveRecord::Migration[4.2] 3 | def up 4 | change_column :spree_prices, :amount, :decimal, precision: 8, scale: 2, null: true 5 | end 6 | 7 | def down 8 | change_column :spree_prices, :amount, :decimal, precision: 8, scale: 2, null: false 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082638_add_currency_to_line_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121107184631) 2 | class AddCurrencyToLineItems < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_line_items, :currency, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082639_add_currency_to_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121107194006) 2 | class AddCurrencyToOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :currency, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082640_add_cost_currency_to_variants.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121109173623) 2 | class AddCostCurrencyToVariants < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_variants, :cost_currency, :string, after: :cost_price 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082641_remove_display_on_from_payment_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121111231553) 2 | class RemoveDisplayOnFromPaymentMethods < ActiveRecord::Migration[4.2] 3 | def up 4 | remove_column :spree_payment_methods, :display_on 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082642_add_position_to_taxonomies.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121124203911) 2 | class AddPositionToTaxonomies < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_taxonomies, :position, :integer, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082643_add_last_ip_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121126040517) 2 | class AddLastIpToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :last_ip_address, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082644_add_state_to_spree_adjustments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20121213162028) 2 | class AddStateToSpreeAdjustments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_adjustments, :state, :string 5 | remove_column :spree_adjustments, :locked 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082645_add_display_on_to_spree_payment_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130114053446) 2 | class AddDisplayOnToSpreePaymentMethods < ActiveRecord::Migration[4.2] 3 | def self.up 4 | add_column :spree_payment_methods, :display_on, :string 5 | end 6 | 7 | def self.down 8 | remove_column :spree_payment_methods, :display_on 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082646_add_position_to_product_properties.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130120201805) 2 | class AddPositionToProductProperties < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_product_properties, :position, :integer, default: 0 5 | end 6 | end 7 | 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082647_add_identifier_to_spree_payments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130203232234) 2 | class AddIdentifierToSpreePayments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_payments, :identifier, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082648_add_order_id_index_to_payments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130207155350) 2 | class AddOrderIdIndexToPayments < ActiveRecord::Migration[4.2] 3 | def self.up 4 | add_index :spree_payments, :order_id 5 | end 6 | 7 | def self.down 8 | remove_index :spree_payments, :order_id 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082649_add_primary_to_spree_products_taxons.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130208032954) 2 | class AddPrimaryToSpreeProductsTaxons < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_products_taxons, :id, :primary_key 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082650_create_spree_stock_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130211190146) 2 | class CreateSpreeStockItems < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_stock_items do |t| 5 | t.belongs_to :stock_location 6 | t.belongs_to :variant 7 | t.integer :count_on_hand, null: false, default: 0 8 | t.integer :lock_version 9 | 10 | t.timestamps null: false 11 | end 12 | add_index :spree_stock_items, :stock_location_id 13 | add_index :spree_stock_items, [:stock_location_id, :variant_id], name: 'stock_item_by_loc_and_var_id' 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180411082651_create_spree_stock_locations.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130211191120) 2 | class CreateSpreeStockLocations < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_stock_locations do |t| 5 | t.string :name 6 | t.belongs_to :address 7 | 8 | t.timestamps null: false 9 | end 10 | add_index :spree_stock_locations, :address_id 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082653_add_order_id_index_to_shipments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130222032153) 2 | class AddOrderIdIndexToShipments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_shipments, :order_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082654_change_meta_description_on_spree_products_to_text.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130226032817) 2 | class ChangeMetaDescriptionOnSpreeProductsToText < ActiveRecord::Migration[4.2] 3 | def change 4 | change_column :spree_products, :meta_description, :text, limit: nil 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082655_add_stock_location_id_to_spree_shipments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130226191231) 2 | class AddStockLocationIdToSpreeShipments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_shipments, :stock_location_id, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082656_add_pending_to_inventory_unit.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130227143905) 2 | class AddPendingToInventoryUnit < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_inventory_units, :pending, :boolean, default: true 5 | Spree::InventoryUnit.update_all(pending: false) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082657_remove_on_demand_from_product_and_variant.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130228164411) 2 | class RemoveOnDemandFromProductAndVariant < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_column :spree_products, :on_demand 5 | remove_column :spree_variants, :on_demand 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082658_create_shipping_method_zone.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130228210442) 2 | class CreateShippingMethodZone < ActiveRecord::Migration[4.2] 3 | class ShippingMethodZone < ApplicationRecord 4 | self.table_name = 'shipping_methods_zones' 5 | end 6 | def up 7 | create_table :shipping_methods_zones, id: false do |t| 8 | t.integer :shipping_method_id 9 | t.integer :zone_id 10 | end 11 | Spree::ShippingMethod.all.each do |sm| 12 | ShippingMethodZone.create!(zone_id: sm.zone_id, shipping_method_id: sm.id) 13 | end 14 | 15 | remove_column :spree_shipping_methods, :zone_id 16 | end 17 | 18 | def down 19 | drop_table :shipping_methods_zones 20 | add_column :spree_shipping_methods, :zone_id, :integer 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /db/migrate/20180411082659_remove_shipping_category_id_from_shipping_method.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130301162745) 2 | class RemoveShippingCategoryIdFromShippingMethod < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_column :spree_shipping_methods, :shipping_category_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082660_create_shipping_method_categories.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130301162924) 2 | class CreateShippingMethodCategories < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_shipping_method_categories do |t| 5 | t.integer :shipping_method_id, null: false 6 | t.integer :shipping_category_id, null: false 7 | 8 | t.timestamps null: false 9 | end 10 | 11 | add_index :spree_shipping_method_categories, :shipping_method_id 12 | add_index :spree_shipping_method_categories, :shipping_category_id 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180411082661_add_tracking_url_to_spree_shipping_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130301205200) 2 | class AddTrackingUrlToSpreeShippingMethods < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_shipping_methods, :tracking_url, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082663_remove_category_match_attributes_from_shipping_method.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130304192936) 2 | class RemoveCategoryMatchAttributesFromShippingMethod < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_column :spree_shipping_methods, :match_none 5 | remove_column :spree_shipping_methods, :match_one 6 | remove_column :spree_shipping_methods, :match_all 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082664_create_stock_movements.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130305143310) 2 | class CreateStockMovements < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_stock_movements do |t| 5 | t.belongs_to :stock_item 6 | t.integer :quantity 7 | t.string :action 8 | 9 | t.timestamps null: false 10 | end 11 | add_index :spree_stock_movements, :stock_item_id 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180411082666_add_active_field_to_stock_locations.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130306191917) 2 | class AddActiveFieldToStockLocations < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_stock_locations, :active, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082667_add_backorderable_to_stock_item.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130306195650) 2 | class AddBackorderableToStockItem < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_stock_items, :backorderable, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082668_add_default_quantity_to_stock_movement.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130307161754) 2 | class AddDefaultQuantityToStockMovement < ActiveRecord::Migration[4.2] 3 | def change 4 | change_column :spree_stock_movements, :quantity, :integer, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082669_add_source_and_destination_to_stock_movements.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130318151756) 2 | class AddSourceAndDestinationToStockMovements < ActiveRecord::Migration[4.2] 3 | def change 4 | change_table :spree_stock_movements do |t| 5 | t.references :source, polymorphic: true 6 | t.references :destination, polymorphic: true 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082670_change_orders_total_precision.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130319062004) 2 | class ChangeOrdersTotalPrecision < ActiveRecord::Migration[4.2] 3 | def change 4 | change_column :spree_orders, :item_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false 5 | change_column :spree_orders, :total, :decimal, precision: 10, scale: 2, default: 0.0, null: false 6 | change_column :spree_orders, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false 7 | change_column :spree_orders, :payment_total, :decimal, precision: 10, scale: 2, default: 0.0 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082671_change_spree_payments_amount_precision.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130319063911) 2 | class ChangeSpreePaymentsAmountPrecision < ActiveRecord::Migration[4.2] 3 | def change 4 | 5 | change_column :spree_payments, :amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false 6 | 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082672_change_spree_return_authorization_amount_precision.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130319064308) 2 | class ChangeSpreeReturnAuthorizationAmountPrecision < ActiveRecord::Migration[4.2] 3 | def change 4 | 5 | change_column :spree_return_authorizations, :amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false 6 | 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082673_change_adjustments_amount_precision.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130319082943) 2 | class ChangeAdjustmentsAmountPrecision < ActiveRecord::Migration[4.2] 3 | def change 4 | 5 | change_column :spree_adjustments, :amount, :decimal, precision: 10, scale: 2 6 | 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082674_add_originator_to_stock_movement.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130319183250) 2 | class AddOriginatorToStockMovement < ActiveRecord::Migration[4.2] 3 | def change 4 | change_table :spree_stock_movements do |t| 5 | t.references :originator, polymorphic: true 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082675_drop_source_and_destination_from_stock_movement.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130319190507) 2 | class DropSourceAndDestinationFromStockMovement < ActiveRecord::Migration[4.2] 3 | def up 4 | change_table :spree_stock_movements do |t| 5 | t.remove_references :source, polymorphic: true 6 | t.remove_references :destination, polymorphic: true 7 | end 8 | end 9 | 10 | def down 11 | change_table :spree_stock_movements do |t| 12 | t.references :source, polymorphic: true 13 | t.references :destination, polymorphic: true 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180411082676_migrate_inventory_unit_sold_to_on_hand.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130325163316) 2 | class MigrateInventoryUnitSoldToOnHand < ActiveRecord::Migration[4.2] 3 | def up 4 | Spree::InventoryUnit.where(state: 'sold').update_all(state: 'on_hand') 5 | end 6 | 7 | def down 8 | Spree::InventoryUnit.where(state: 'on_hand').update_all(state: 'sold') 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082677_add_stock_location_to_rma.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130326175857) 2 | class AddStockLocationToRma < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_return_authorizations, :stock_location_id, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082678_update_shipment_state_for_canceled_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130328130308) 2 | class UpdateShipmentStateForCanceledOrders < ActiveRecord::Migration[4.2] 3 | def up 4 | shipments = Spree::Shipment.joins(:order). 5 | where("spree_orders.state = 'canceled'") 6 | case Spree::Shipment.connection.adapter_name 7 | when "SQLite3" 8 | shipments.update_all("state = 'cancelled'") 9 | when "MySQL" || "PostgreSQL" 10 | shipments.update_all("spree_shipments.state = 'cancelled'") 11 | end 12 | end 13 | 14 | def down 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180411082679_add_seo_metas_to_taxons.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130328195253) 2 | class AddSeoMetasToTaxons < ActiveRecord::Migration[4.2] 3 | def change 4 | change_table :spree_taxons do |t| 5 | t.string :meta_title 6 | t.string :meta_description 7 | t.string :meta_keywords 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082680_remove_stock_item_and_variant_lock.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130329134939) 2 | class RemoveStockItemAndVariantLock < ActiveRecord::Migration[4.2] 3 | def up 4 | # we are moving to pessimistic locking on stock_items 5 | remove_column :spree_stock_items, :lock_version 6 | 7 | # variants no longer manage their count_on_hand so we are removing their lock 8 | remove_column :spree_variants, :lock_version 9 | end 10 | 11 | def down 12 | add_column :spree_stock_items, :lock_version, :integer 13 | add_column :spree_variants, :lock_version, :integer 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180411082681_add_name_to_spree_credit_cards.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130413230529) 2 | class AddNameToSpreeCreditCards < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_credit_cards, :name, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082682_update_name_fields_on_spree_credit_cards.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130414000512) 2 | class UpdateNameFieldsOnSpreeCreditCards < ActiveRecord::Migration[4.2] 3 | def up 4 | if ApplicationRecord.connection.adapter_name.downcase.include? "mysql" 5 | execute "UPDATE spree_credit_cards SET name = CONCAT(first_name, ' ', last_name)" 6 | else 7 | execute "UPDATE spree_credit_cards SET name = first_name || ' ' || last_name" 8 | end 9 | end 10 | 11 | def down 12 | execute "UPDATE spree_credit_cards SET name = NULL" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180411082683_add_index_to_source_columns_on_adjustments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130417120034) 2 | class AddIndexToSourceColumnsOnAdjustments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_adjustments, [:source_type, :source_id] 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082684_update_adjustment_states.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130417120035) 2 | class UpdateAdjustmentStates < ActiveRecord::Migration[4.2] 3 | def up 4 | Spree::Order.complete.find_each do |order| 5 | order.adjustments.update_all(state: 'closed') 6 | end 7 | 8 | Spree::Shipment.shipped.includes(:adjustment).find_each do |shipment| 9 | shipment.adjustment.update_column(:state, 'finalized') if shipment.adjustment 10 | end 11 | 12 | Spree::Adjustment.where(state: nil).update_all(state: 'open') 13 | end 14 | 15 | def down 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180411082685_add_shipping_rates_to_shipments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130417123427) 2 | class AddShippingRatesToShipments < ActiveRecord::Migration[4.2] 3 | def up 4 | Spree::Shipment.find_each do |shipment| 5 | shipment.shipping_rates.create(shipping_method_id: shipment.shipping_method_id, 6 | cost: shipment.cost, 7 | selected: true) 8 | end 9 | 10 | remove_column :spree_shipments, :shipping_method_id 11 | end 12 | 13 | def down 14 | add_column :spree_shipments, :shipping_method_id, :integer 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180411082686_create_spree_stock_transfers.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130418125341) 2 | class CreateSpreeStockTransfers < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_stock_transfers do |t| 5 | t.string :type 6 | t.string :reference_number 7 | t.integer :source_location_id 8 | t.integer :destination_location_id 9 | t.timestamps null: false 10 | end 11 | 12 | add_index :spree_stock_transfers, :source_location_id 13 | add_index :spree_stock_transfers, :destination_location_id 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180411082687_drop_products_count_on_hand.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130423110707) 2 | class DropProductsCountOnHand < ActiveRecord::Migration[4.2] 3 | def up 4 | remove_column :spree_products, :count_on_hand 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082688_set_default_shipping_rate_cost.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130423223847) 2 | class SetDefaultShippingRateCost < ActiveRecord::Migration[4.2] 3 | def change 4 | change_column :spree_shipping_rates, :cost, :decimal, default: 0, precision: 8, scale: 2 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082690_add_sku_index_to_spree_variants.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130514151929) 2 | class AddSkuIndexToSpreeVariants < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_variants, :sku 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082691_add_backorderable_default_to_spree_stock_location.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130515180736) 2 | class AddBackorderableDefaultToSpreeStockLocation < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_stock_locations, :backorderable_default, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082692_add_propage_all_variants_to_spree_stock_location.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130516151222) 2 | class AddPropageAllVariantsToSpreeStockLocation < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_stock_locations, :propagate_all_variants, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082693_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130611054351) 2 | class RenameShippingMethodsZonesToSpreeShippingMethodsZones < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_table :shipping_methods_zones, :spree_shipping_methods_zones 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082694_add_user_id_index_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130611185927) 2 | class AddUserIdIndexToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_orders, :user_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082695_add_updated_at_to_spree_countries.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130618041418) 2 | class AddUpdatedAtToSpreeCountries < ActiveRecord::Migration[4.2] 3 | def up 4 | add_column :spree_countries, :updated_at, :datetime 5 | end 6 | 7 | def down 8 | remove_column :spree_countries, :updated_at 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082696_add_updated_at_to_spree_states.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130619012236) 2 | class AddUpdatedAtToSpreeStates < ActiveRecord::Migration[4.2] 3 | def up 4 | add_column :spree_states, :updated_at, :datetime 5 | end 6 | 7 | def down 8 | remove_column :spree_states, :updated_at 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082697_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130626232741) 2 | class AddCvvResultCodeAndCvvResultMessageToSpreePayments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_payments, :cvv_response_code, :string 5 | add_column :spree_payments, :cvv_response_message, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082698_add_unique_index_to_permalink_on_spree_products.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130628021056) 2 | class AddUniqueIndexToPermalinkOnSpreeProducts < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index "spree_products", ["permalink"], name: "permalink_idx_unique", unique: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082699_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130628022817) 2 | class AddUniqueIndexToOrdersShipmentsAndStockTransfers < ActiveRecord::Migration[4.2] 3 | def add 4 | add_index "spree_orders", ["number"], name: "number_idx_unique", unique: true 5 | add_index "spree_shipments", ["number"], name: "number_idx_unique", unique: true 6 | add_index "spree_stock_transfers", ["number"], name: "number_idx_unique", unique: true 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082700_add_deleted_at_to_spree_tax_rates.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130708052307) 2 | class AddDeletedAtToSpreeTaxRates < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_tax_rates, :deleted_at, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082701_remove_lock_version_from_inventory_units.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130711200933) 2 | class RemoveLockVersionFromInventoryUnits < ActiveRecord::Migration[4.2] 3 | def change 4 | # we are moving to pessimistic locking on stock_items 5 | remove_column :spree_inventory_units, :lock_version 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082702_add_cost_price_to_line_item.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130718042445) 2 | class AddCostPriceToLineItem < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_line_items, :cost_price, :decimal, precision: 8, scale: 2 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082703_set_backorderable_to_default_to_false.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130718233855) 2 | class SetBackorderableToDefaultToFalse < ActiveRecord::Migration[4.2] 3 | def change 4 | change_column :spree_stock_items, :backorderable, :boolean, default: false 5 | change_column :spree_stock_locations, :backorderable_default, :boolean, default: false 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082704_add_created_by_id_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130725031716) 2 | class AddCreatedByIdToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :created_by_id, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082705_index_completed_at_on_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130729214043) 2 | class IndexCompletedAtOnSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_orders, :completed_at 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082706_add_tax_category_id_to_spree_line_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130802014537) 2 | class AddTaxCategoryIdToSpreeLineItems < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_line_items, :tax_category_id, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082707_migrate_tax_categories_to_line_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130802022321) 2 | class MigrateTaxCategoriesToLineItems < ActiveRecord::Migration[4.2] 3 | def change 4 | Spree::LineItem.find_each do |line_item| 5 | next if line_item.variant.nil? 6 | next if line_item.variant.product.nil? 7 | next if line_item.product.nil? 8 | line_item.update_column(:tax_category_id, line_item.product.tax_category_id) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082708_drop_spree_mail_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130806022521) 2 | class DropSpreeMailMethods < ActiveRecord::Migration[4.2] 3 | def up 4 | drop_table :spree_mail_methods 5 | end 6 | 7 | def down 8 | create_table(:spree_mail_methods) do |t| 9 | t.string :environment 10 | t.boolean :active 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180411082709_set_default_stock_location_on_shipments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130806145853) 2 | class SetDefaultStockLocationOnShipments < ActiveRecord::Migration[4.2] 3 | def change 4 | if Spree::Shipment.where('stock_location_id IS NULL').count > 0 5 | location = Spree::StockLocation.find_by(name: 'default') || Spree::StockLocation.first 6 | Spree::Shipment.where('stock_location_id IS NULL').update_all(stock_location_id: location.id) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082712_add_admin_name_column_to_spree_shipping_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130809164245) 2 | class AddAdminNameColumnToSpreeShippingMethods < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_shipping_methods, :admin_name, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082713_add_admin_name_column_to_spree_stock_locations.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130809164330) 2 | class AddAdminNameColumnToSpreeStockLocations < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_stock_locations, :admin_name, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082714_add_shipment_total_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130813004002) 2 | class AddShipmentTotalToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :shipment_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082715_expand_order_number_size.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130813140619) 2 | class ExpandOrderNumberSize < ActiveRecord::Migration[4.2] 3 | def up 4 | change_column :spree_orders, :number, :string, limit: 32 5 | end 6 | 7 | def down 8 | change_column :spree_orders, :number, :string, limit: 15 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082716_rename_activators_to_promotions.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130813232134) 2 | class RenameActivatorsToPromotions < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_table :spree_activators, :spree_promotions 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082717_add_adjustment_total_to_line_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130815000406) 2 | class AddAdjustmentTotalToLineItems < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_line_items, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082718_add_adjustment_total_to_shipments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130815024413) 2 | class AddAdjustmentTotalToShipments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_shipments, :adjustment_total, :decimal, precision: 10, scale: 2, default: 0.0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082719_add_depth_to_spree_taxons.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130826062534) 2 | class AddDepthToSpreeTaxons < ActiveRecord::Migration[4.2] 3 | def up 4 | if !Spree::Taxon.column_names.include?('depth') 5 | add_column :spree_taxons, :depth, :integer 6 | 7 | say_with_time 'Update depth on all taxons' do 8 | Spree::Taxon.reset_column_information 9 | Spree::Taxon.all.each { |t| t.save } 10 | end 11 | end 12 | end 13 | 14 | def down 15 | remove_column :spree_taxons, :depth 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180411082720_add_tax_total_to_line_items_shipments_and_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130828234942) 2 | class AddTaxTotalToLineItemsShipmentsAndOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_line_items, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0 5 | add_column :spree_shipments, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0 6 | # This column may already be here from a 2.1.x migration 7 | add_column :spree_orders, :tax_total, :decimal, precision: 10, scale: 2, default: 0.0 unless column_exists? :spree_orders, :tax_total, :decimal 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082721_add_shipping_category_to_shipping_methods_and_products.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130830001033) 2 | class AddShippingCategoryToShippingMethodsAndProducts < ActiveRecord::Migration[4.2] 3 | def up 4 | default_category = Spree::ShippingCategory.first 5 | default_category ||= Spree::ShippingCategory.create!(name: "Default") 6 | 7 | Spree::ShippingMethod.all.each do |method| 8 | method.shipping_categories << default_category if method.shipping_categories.blank? 9 | end 10 | 11 | Spree::Product.where(shipping_category_id: nil).update_all(shipping_category_id: default_category.id) 12 | end 13 | 14 | def down 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180411082723_add_code_to_spree_promotion_rules.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130903183026) 2 | class AddCodeToSpreePromotionRules < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_promotion_rules, :code, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082724_change_states_required_for_countries.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130909115621) 2 | class ChangeStatesRequiredForCountries < ActiveRecord::Migration[4.2] 3 | def up 4 | change_column_default :spree_countries, :states_required, false 5 | end 6 | 7 | def down 8 | change_column_default :spree_countries, :states_required, true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082725_add_deleted_at_to_spree_stock_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130915032339) 2 | class AddDeletedAtToSpreeStockItems < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_stock_items, :deleted_at, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082726_remove_promotions_event_name_field.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130917024658) 2 | class RemovePromotionsEventNameField < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_column :spree_promotions, :event_name, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082727_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20130924040529) 2 | class AddPromoTotalToLineItemsAndShipmentsAndOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_line_items, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0 5 | add_column :spree_shipments, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0 6 | add_column :spree_orders, :promo_total, :decimal, precision: 10, scale: 2, default: 0.0 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082729_add_track_inventory_to_variant.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131026154747) 2 | class AddTrackInventoryToVariant < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_variants, :track_inventory, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082730_add_tax_category_to_variants.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131107132123) 2 | class AddTaxCategoryToVariants < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_variants, :tax_category_id, :integer 5 | add_index :spree_variants, :tax_category_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082731_add_channel_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131113035136) 2 | class AddChannelToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :channel, :string, default: "spree" 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082732_add_included_to_adjustments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131118043959) 2 | class AddIncludedToAdjustments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_adjustments, :included, :boolean, default: false unless Spree::Adjustment.column_names.include?("included") 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082733_rename_tax_total_fields.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131118050234) 2 | class RenameTaxTotalFields < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_column :spree_line_items, :tax_total, :additional_tax_total 5 | rename_column :spree_shipments, :tax_total, :additional_tax_total 6 | rename_column :spree_orders, :tax_total, :additional_tax_total 7 | 8 | add_column :spree_line_items, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 9 | add_column :spree_shipments, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 10 | add_column :spree_orders, :included_tax_total, :decimal, precision: 10, scale: 2, null: false, default: 0.0 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082735_add_updated_at_to_variants.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131120234456) 2 | class AddUpdatedAtToVariants < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_variants, :updated_at, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082736_add_position_to_classifications.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131127001002) 2 | class AddPositionToClassifications < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_products_taxons, :position, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082737_create_spree_orders_promotions.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131211112807) 2 | class CreateSpreeOrdersPromotions < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_orders_promotions, id: false do |t| 5 | t.references :order 6 | t.references :promotion 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082739_add_item_count_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20131218054603) 2 | class AddItemCountToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :item_count, :integer, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082740_remove_value_type_from_spree_preferences.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140106065820) 2 | class RemoveValueTypeFromSpreePreferences < ActiveRecord::Migration[4.2] 3 | def up 4 | remove_column :spree_preferences, :value_type 5 | end 6 | def down 7 | raise ActiveRecord::IrreversableMigration 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082741_rename_permalink_to_slug_for_products.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140106224208) 2 | class RenamePermalinkToSlugForProducts < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_column :spree_products, :permalink, :slug 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082742_add_index_to_variant_id_and_currency_on_prices.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140120160805) 2 | class AddIndexToVariantIdAndCurrencyOnPrices < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_prices, [:variant_id, :currency] 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082743_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140124023232) 2 | class RenameActivatorIdInRulesAndActionsToPromotionId < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_column :spree_promotion_rules, :activator_id, :promotion_id 5 | rename_column :spree_promotion_actions, :activator_id, :promotion_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082744_add_deleted_at_to_spree_prices.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140129024326) 2 | class AddDeletedAtToSpreePrices < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_prices, :deleted_at, :datetime 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082745_add_approver_id_and_approved_at_to_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140203161722) 2 | class AddApproverIdAndApprovedAtToOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :approver_id, :integer 5 | add_column :spree_orders, :approved_at, :datetime 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082746_add_confirmation_delivered_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140204115338) 2 | class AddConfirmationDeliveredToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :confirmation_delivered, :boolean, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082747_add_auto_capture_to_payment_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140204192230) 2 | class AddAutoCaptureToPaymentMethods < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_payment_methods, :auto_capture, :boolean 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082748_create_spree_payment_capture_events.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140205120320) 2 | class CreateSpreePaymentCaptureEvents < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_payment_capture_events do |t| 5 | t.decimal :amount, precision: 10, scale: 2, default: 0.0 6 | t.integer :payment_id 7 | 8 | t.timestamps null: false 9 | end 10 | 11 | add_index :spree_payment_capture_events, :payment_id 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180411082749_add_uncaptured_amount_to_payments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140205144710) 2 | class AddUncapturedAmountToPayments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_payments, :uncaptured_amount, :decimal, precision: 10, scale: 2, default: 0.0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082750_default_variant_weight_to_zero.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140205181631) 2 | class DefaultVariantWeightToZero < ActiveRecord::Migration[4.2] 3 | def up 4 | Spree::Variant.unscoped.where(weight: nil).update_all("weight = 0.0") 5 | 6 | change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2, default: 0.0 7 | end 8 | 9 | def down 10 | change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082751_add_tax_category_id_to_shipping_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140207085910) 2 | class AddTaxCategoryIdToShippingMethods < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_shipping_methods, :tax_category_id, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082752_add_tax_rate_id_to_shipping_rates.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140207093021) 2 | class AddTaxRateIdToShippingRates < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_shipping_rates, :tax_rate_id, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082753_add_pre_tax_amount_to_line_items_and_shipments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140211040159) 2 | class AddPreTaxAmountToLineItemsAndShipments < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_line_items, :pre_tax_amount, :decimal, precision: 8, scale: 2 5 | add_column :spree_shipments, :pre_tax_amount, :decimal, precision: 8, scale: 2 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082754_add_more_indexes.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140213184916) 2 | class AddMoreIndexes < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_payment_methods, [:id, :type] 5 | add_index :spree_calculators, [:id, :type] 6 | add_index :spree_calculators, [:calculable_id, :calculable_type] 7 | add_index :spree_payments, :payment_method_id 8 | add_index :spree_promotion_actions, [:id, :type] 9 | add_index :spree_promotion_actions, :promotion_id 10 | add_index :spree_promotions, [:id, :type] 11 | add_index :spree_option_values, :option_type_id 12 | add_index :spree_shipments, :stock_location_id 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180411082755_add_considered_risky_to_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140219060952) 2 | class AddConsideredRiskyToOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :considered_risky, :boolean, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082756_add_preference_store_to_everything.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140227112348) 2 | class AddPreferenceStoreToEverything < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_calculators, :preferences, :text 5 | add_column :spree_gateways, :preferences, :text 6 | add_column :spree_payment_methods, :preferences, :text 7 | add_column :spree_promotion_rules, :preferences, :text 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082757_add_user_id_to_spree_credit_cards.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140307235515) 2 | class AddUserIdToSpreeCreditCards < ActiveRecord::Migration[4.2] 3 | def change 4 | unless Spree::CreditCard.column_names.include? "user_id" 5 | add_column :spree_credit_cards, :user_id, :integer 6 | add_index :spree_credit_cards, :user_id 7 | end 8 | 9 | unless Spree::CreditCard.column_names.include? "payment_method_id" 10 | add_column :spree_credit_cards, :payment_method_id, :integer 11 | add_index :spree_credit_cards, :payment_method_id 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180411082758_migrate_old_preferences.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140309023735) 2 | class MigrateOldPreferences < ActiveRecord::Migration[4.2] 3 | def up 4 | migrate_preferences(Spree::Calculator) 5 | migrate_preferences(Spree::PaymentMethod) 6 | migrate_preferences(Spree::PromotionRule) 7 | end 8 | 9 | def down 10 | end 11 | 12 | private 13 | def migrate_preferences klass 14 | klass.reset_column_information 15 | klass.find_each do |record| 16 | store = Spree::Preferences::ScopedStore.new(record.class.name.underscore, record.id) 17 | record.defined_preferences.each do |key| 18 | value = store.fetch(key){} 19 | record.preferences[key] = value unless value.nil? 20 | end 21 | record.save! 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /db/migrate/20180411082761_add_timestamps_to_spree_assets.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140315053743) 2 | class AddTimestampsToSpreeAssets < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_assets, :created_at, :datetime 5 | add_column :spree_assets, :updated_at, :datetime 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082762_create_spree_taxons_promotion_rules.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140318191500) 2 | class CreateSpreeTaxonsPromotionRules < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_taxons_promotion_rules do |t| 5 | t.references :taxon, index: true 6 | t.references :promotion_rule, index: true 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082763_add_additional_store_fields.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140331100557) 2 | class AddAdditionalStoreFields < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_stores, :code, :string unless column_exists?(:spree_stores, :code) 5 | add_column :spree_stores, :default, :boolean, default: false, null: false unless column_exists?(:spree_stores, :default) 6 | add_index :spree_stores, :code 7 | add_index :spree_stores, :default 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082766_add_user_id_created_by_id_index_to_order.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140415041315) 2 | class AddUserIdCreatedByIdIndexToOrder < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_orders, [:user_id, :created_by_id] 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082767_change_spree_price_amount_precision.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140508151342) 2 | class ChangeSpreePriceAmountPrecision < ActiveRecord::Migration[4.2] 3 | def change 4 | change_column :spree_prices, :amount, :decimal, precision: 10, scale: 2 5 | change_column :spree_line_items, :price, :decimal, precision: 10, scale: 2 6 | change_column :spree_line_items, :cost_price, :decimal, precision: 10, scale: 2 7 | change_column :spree_variants, :cost_price, :decimal, precision: 10, scale: 2 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082768_add_token_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140518174634) 2 | class AddTokenToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :guest_token, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082770_set_shipment_total_for_users_upgrading.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140601011216) 2 | class SetShipmentTotalForUsersUpgrading < ActiveRecord::Migration[4.2] 3 | def up 4 | # NOTE You might not need this at all unless you're upgrading from Spree 2.1.x 5 | # or below. For those upgrading this should populate the Order#shipment_total 6 | # for legacy orders 7 | Spree::Order.complete.where('shipment_total = ?', 0).includes(:shipments).find_each do |order| 8 | order.update_column(:shipment_total, order.shipments.sum(:cost)) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082771_drop_credit_card_first_name_and_last_name.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140604135309) 2 | class DropCreditCardFirstNameAndLastName < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_column :spree_credit_cards, :first_name, :string 5 | remove_column :spree_credit_cards, :last_name, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082772_add_deleted_at_to_spree_promotion_actions.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140609201656) 2 | class AddDeletedAtToSpreePromotionActions < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_promotion_actions, :deleted_at, :datetime 5 | add_index :spree_promotion_actions, :deleted_at 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082773_remove_uncaptured_amount_from_spree_payments.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140616202624) 2 | class RemoveUncapturedAmountFromSpreePayments < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_column :spree_payments, :uncaptured_amount 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082774_create_spree_refunds.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140625214618) 2 | class CreateSpreeRefunds < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_refunds do |t| 5 | t.integer :payment_id 6 | t.integer :return_authorization_id 7 | t.decimal :amount, precision: 10, scale: 2, default: 0.0, null: false 8 | t.string :transaction_id 9 | 10 | t.timestamps null: false 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180411082775_create_spree_return_authorization_inventory_unit.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140702140656) 2 | class CreateSpreeReturnAuthorizationInventoryUnit < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_return_authorization_inventory_units do |t| 5 | t.integer :return_authorization_id 6 | t.integer :inventory_unit_id 7 | t.integer :exchange_variant_id 8 | t.datetime :received_at 9 | 10 | t.timestamps null: false 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180411082776_rename_return_authorization_inventory_unit_to_return_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140707125621) 2 | class RenameReturnAuthorizationInventoryUnitToReturnItems < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_table :spree_return_authorization_inventory_units, :spree_return_items 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082777_backfill_line_item_pre_tax_amount.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140709160534) 2 | class BackfillLineItemPreTaxAmount < ActiveRecord::Migration[4.2] 3 | def change 4 | # set pre_tax_amount to discounted_amount - included_tax_total 5 | execute(<<-SQL) 6 | UPDATE spree_line_items 7 | SET pre_tax_amount = ((price * quantity) + promo_total) - included_tax_total 8 | WHERE pre_tax_amount IS NULL; 9 | SQL 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082779_add_amount_fields_to_return_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140710181204) 2 | class AddAmountFieldsToReturnItems < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_return_items, :pre_tax_amount, :decimal, precision: 10, scale: 2, default: 0.0, null: false 5 | add_column :spree_return_items, :included_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false 6 | add_column :spree_return_items, :additional_tax_total, :decimal, precision: 10, scale: 2, default: 0.0, null: false 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082780_drop_return_authorization_amount.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140710190048) 2 | class DropReturnAuthorizationAmount < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_column :spree_return_authorizations, :amount 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082782_create_spree_refund_reasons.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140713140527) 2 | class CreateSpreeRefundReasons < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_refund_reasons do |t| 5 | t.string :name 6 | t.boolean :active, default: true 7 | t.boolean :mutable, default: true 8 | 9 | t.timestamps null: false 10 | end 11 | 12 | add_column :spree_refunds, :refund_reason_id, :integer 13 | add_index :spree_refunds, :refund_reason_id, name: 'index_refunds_on_refund_reason_id' 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180411082783_rename_return_authorization_reason.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140713142214) 2 | class RenameReturnAuthorizationReason < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_column :spree_return_authorizations, :reason, :memo 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082784_create_spree_promotion_categories.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140715182625) 2 | class CreateSpreePromotionCategories < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_promotion_categories do |t| 5 | t.string :name 6 | t.timestamps null: false 7 | end 8 | 9 | add_column :spree_promotions, :promotion_category_id, :integer 10 | add_index :spree_promotions, :promotion_category_id 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082785_drop_received_at_on_return_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140716204111) 2 | class DropReceivedAtOnReturnItems < ActiveRecord::Migration[4.2] 3 | def up 4 | remove_column :spree_return_items, :received_at 5 | end 6 | 7 | def down 8 | add_column :spree_return_items, :received_at, :datetime 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082786_add_reception_and_acceptance_status_to_return_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140716212330) 2 | class AddReceptionAndAcceptanceStatusToReturnItems < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_return_items, :reception_status, :string 5 | add_column :spree_return_items, :acceptance_status, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082787_create_default_refund_reason.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140717155155) 2 | class CreateDefaultRefundReason < ActiveRecord::Migration[4.2] 3 | def up 4 | Spree::RefundReason.create!(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false) 5 | end 6 | 7 | def down 8 | Spree::RefundReason.find_by(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false).destroy 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082788_add_default_to_spree_stock_locations.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140717185932) 2 | class AddDefaultToSpreeStockLocations < ActiveRecord::Migration[4.2] 3 | def change 4 | unless column_exists? :spree_stock_locations, :default 5 | add_column :spree_stock_locations, :default, :boolean, null: false, default: false 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082789_create_spree_customer_returns.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140718133010) 2 | class CreateSpreeCustomerReturns < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_customer_returns do |t| 5 | t.string :number 6 | t.integer :stock_location_id 7 | t.timestamps null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082790_add_customer_return_id_to_return_item.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140718133349) 2 | class AddCustomerReturnIdToReturnItem < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_return_items, :customer_return_id, :integer 5 | add_index :spree_return_items, :customer_return_id, name: 'index_return_items_on_customer_return_id' 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082791_create_friendly_id_slugs.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140718195325) 2 | class CreateFriendlyIdSlugs < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :friendly_id_slugs do |t| 5 | t.string :slug, null: false 6 | t.integer :sluggable_id, null: false 7 | t.string :sluggable_type, limit: 50 8 | t.string :scope 9 | t.datetime :created_at 10 | end 11 | add_index :friendly_id_slugs, :sluggable_id 12 | add_index :friendly_id_slugs, [:slug, :sluggable_type] 13 | add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], unique: true 14 | add_index :friendly_id_slugs, :sluggable_type 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180411082792_rename_spree_refund_return_authorization_id.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140723004419) 2 | class RenameSpreeRefundReturnAuthorizationId < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_column :spree_refunds, :return_authorization_id, :customer_return_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082794_copy_product_slugs_to_slug_history.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140723214541) 2 | class CopyProductSlugsToSlugHistory < ActiveRecord::Migration[4.2] 3 | def change 4 | 5 | # do what sql does best: copy all slugs into history table in a single query 6 | # rather than load potentially millions of products into memory 7 | Spree::Product.connection.execute <<-SQL 8 | INSERT INTO #{FriendlyId::Slug.table_name} (slug, sluggable_id, sluggable_type, created_at) 9 | SELECT slug, id, '#{Spree::Product.to_s}', #{ApplicationRecord.send(:sanitize_sql_array, ['?', Time.current])} 10 | FROM #{Spree::Product.table_name} 11 | WHERE slug IS NOT NULL 12 | ORDER BY id 13 | SQL 14 | 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180411082796_add_promotionable_to_spree_products.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140728225422) 2 | class AddPromotionableToSpreeProducts < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_products, :promotionable, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082797_add_exchange_inventory_unit_foreign_keys.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140729133613) 2 | class AddExchangeInventoryUnitForeignKeys < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_return_items, :exchange_inventory_unit_id, :integer 5 | 6 | add_index :spree_return_items, :exchange_inventory_unit_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082798_add_acceptance_status_errors_to_return_item.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140730155938) 2 | class AddAcceptanceStatusErrorsToReturnItem < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_return_items, :acceptance_status_errors, :text 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082799_create_spree_reimbursement_types.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140731150017) 2 | class CreateSpreeReimbursementTypes < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_reimbursement_types do |t| 5 | t.string :name 6 | t.boolean :active, default: true 7 | t.boolean :mutable, default: true 8 | 9 | t.timestamps null: false 10 | end 11 | 12 | reversible do |direction| 13 | direction.up do 14 | Spree::ReimbursementType.create!(name: Spree::ReimbursementType::ORIGINAL) 15 | end 16 | end 17 | 18 | add_column :spree_return_items, :preferred_reimbursement_type_id, :integer 19 | add_column :spree_return_items, :override_reimbursement_type_id, :integer 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /db/migrate/20180411082800_add_default_to_shipment_cost.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140804185157) 2 | class AddDefaultToShipmentCost < ActiveRecord::Migration[4.2] 3 | def up 4 | change_column :spree_shipments, :cost, :decimal, precision: 10, scale: 2, default: 0.0 5 | Spree::Shipment.where(cost: nil).update_all(cost: 0) 6 | end 7 | 8 | def down 9 | change_column :spree_shipments, :cost, :decimal, precision: 10, scale: 2 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082801_add_default_to_spree_credit_cards.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140805171035) 2 | class AddDefaultToSpreeCreditCards < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_credit_cards, :default, :boolean, null: false, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082802_make_existing_credit_cards_default.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140805171219) 2 | class MakeExistingCreditCardsDefault < ActiveRecord::Migration[4.2] 3 | def up 4 | # set the newest credit card for every user to be the default; SQL technique from 5 | # http://stackoverflow.com/questions/121387/fetch-the-row-which-has-the-max-value-for-a-column 6 | Spree::CreditCard.where.not(user_id: nil).joins("LEFT OUTER JOIN spree_credit_cards cc2 ON cc2.user_id = spree_credit_cards.user_id AND spree_credit_cards.created_at < cc2.created_at").where("cc2.user_id IS NULL").update_all(default: true) 7 | end 8 | def down 9 | # do nothing 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082803_add_type_to_reimbursement_type.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140806144901) 2 | class AddTypeToReimbursementType < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_reimbursement_types, :type, :string 5 | add_index :spree_reimbursement_types, :type 6 | 7 | Spree::ReimbursementType.reset_column_information 8 | Spree::ReimbursementType.find_by(name: Spree::ReimbursementType::ORIGINAL).update_attributes!(type: 'Spree::ReimbursementType::OriginalPayment') 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082804_create_spree_reimbursement_credits.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140808184039) 2 | class CreateSpreeReimbursementCredits < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_reimbursement_credits do |t| 5 | t.decimal :amount, precision: 10, scale: 2, default: 0.0, null: false 6 | t.integer :reimbursement_id 7 | t.integer :creditable_id 8 | t.string :creditable_type 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082805_add_meta_title_to_spree_products.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140827170513) 2 | class AddMetaTitleToSpreeProducts < ActiveRecord::Migration[4.2] 3 | def change 4 | change_table :spree_products do |t| 5 | t.string :meta_title 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082806_add_kind_to_zone.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140911173301) 2 | class AddKindToZone < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_zones, :kind, :string 5 | add_index :spree_zones, :kind 6 | 7 | Spree::Zone.find_each do |zone| 8 | last_type = zone.members.where.not(zoneable_type: nil).pluck(:zoneable_type).last 9 | zone.update_column :kind, last_type.demodulize.underscore if last_type 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082807_add_code_to_spree_tax_categories.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140924164824) 2 | class AddCodeToSpreeTaxCategories < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_tax_categories, :tax_code, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082808_default_pre_tax_amount_should_be_zero.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20140927193717) 2 | class DefaultPreTaxAmountShouldBeZero < ActiveRecord::Migration[4.2] 3 | def change 4 | change_column :spree_line_items, :pre_tax_amount, :decimal, precision: 8, scale: 2, default: 0 5 | change_column :spree_shipments, :pre_tax_amount, :decimal, precision: 8, scale: 2, default: 0 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082809_add_code_to_spree_shipping_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141002191113) 2 | class AddCodeToSpreeShippingMethods < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_shipping_methods, :code, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082810_add_cancel_audit_fields_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141007230328) 2 | class AddCancelAuditFieldsToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :canceled_at, :datetime 5 | add_column :spree_orders, :canceler_id, :integer 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082811_add_store_id_to_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141009204607) 2 | class AddStoreIdToOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :store_id, :integer 5 | if Spree::Store.default.persisted? 6 | Spree::Order.where(store_id: nil).update_all(store_id: Spree::Store.default.id) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082812_create_spree_taxons_prototypes.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141012083513) 2 | class CreateSpreeTaxonsPrototypes < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_taxons_prototypes do |t| 5 | t.belongs_to :taxon, index: true 6 | t.belongs_to :prototype, index: true 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082813_add_state_lock_version_to_order.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141021194502) 2 | class AddStateLockVersionToOrder < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_orders, :state_lock_version, :integer, default: 0, null: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082814_add_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141023005240) 2 | class AddCounterCacheFromSpreeVariantsToSpreeStockItems < ActiveRecord::Migration[4.2] 3 | # This was unnecessary and was removed 4 | def up 5 | end 6 | 7 | def down 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082815_fix_adjustment_order_presence.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141101231208) 2 | class FixAdjustmentOrderPresence < ActiveRecord::Migration[4.2] 3 | def change 4 | say 'Fixing adjustments without direct order reference' 5 | Spree::Adjustment.where(order: nil).find_each do |adjustment| 6 | adjustable = adjustment.adjustable 7 | if adjustable.is_a? Spree::Order 8 | adjustment.update_attributes!(order_id: adjustable.id) 9 | else 10 | adjustment.update_attributes!(adjustable: adjustable.order) 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180411082816_update_classifications_positions.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141105213646) 2 | class UpdateClassificationsPositions < ActiveRecord::Migration[4.2] 3 | def up 4 | Spree::Taxon.all.each do |taxon| 5 | taxon.classifications.each_with_index do |c12n, i| 6 | c12n.set_list_position(i + 1) 7 | end 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082817_add_guest_token_index_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141120135441) 2 | class AddGuestTokenIndexToSpreeOrders < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_orders, :guest_token 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082818_remove_token_permissions_table.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141215232040) 2 | class RemoveTokenPermissionsTable < ActiveRecord::Migration[4.2] 3 | def change 4 | # The MoveOrderTokenFromTokenizedPermission migration never dropped this. 5 | drop_table :spree_tokenized_permissions 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082819_remove_extra_products_slug_index.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141215235502) 2 | class RemoveExtraProductsSlugIndex < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_index :spree_products, name: :permalink_idx_unique 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082820_update_product_slug_index.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141217215630) 2 | class UpdateProductSlugIndex < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_index :spree_products, :slug if index_exists?(:spree_products, :slug) 5 | add_index :spree_products, :slug, unique: true 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082821_rename_identifier_to_number_for_payment.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20141218025915) 2 | class RenameIdentifierToNumberForPayment < ActiveRecord::Migration[4.2] 3 | def change 4 | rename_column :spree_payments, :identifier, :number 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082823_create_spree_store_credit_categories.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150118211500) 2 | class CreateSpreeStoreCreditCategories < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_store_credit_categories do |t| 5 | t.string :name 6 | t.timestamps null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082825_create_spree_store_credit_types.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150118212101) 2 | class CreateSpreeStoreCreditTypes < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_store_credit_types do |t| 5 | t.string :name 6 | t.integer :priority 7 | t.timestamps null: false 8 | end 9 | add_index :spree_store_credit_types, :priority 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082826_remove_environment_from_payment_method.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150121022521) 2 | class RemoveEnvironmentFromPaymentMethod < ActiveRecord::Migration[4.2] 3 | def up 4 | Spree::PaymentMethod.where('environment != ?', Rails.env).update_all(active: false) 5 | remove_column :spree_payment_methods, :environment 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082827_add_resellable_to_return_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150122145607) 2 | class AddResellableToReturnItems < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_return_items, :resellable, :boolean, default: true, null: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082828_add_code_to_spree_promotion_categories.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150122202432) 2 | class AddCodeToSpreePromotionCategories < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_promotion_categories, :code, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082829_remove_environment_from_tracker.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150128032538) 2 | class RemoveEnvironmentFromTracker < ActiveRecord::Migration[4.2] 3 | class Spree::Tracker < Spree::Base; end 4 | 5 | def up 6 | Spree::Tracker.where('environment != ?', Rails.env).update_all(active: false) 7 | remove_column :spree_trackers, :environment 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082830_remove_spree_configurations.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150128060325) 2 | class RemoveSpreeConfigurations < ActiveRecord::Migration[4.2] 3 | def up 4 | drop_table "spree_configurations" 5 | end 6 | 7 | def down 8 | create_table "spree_configurations", force: true do |t| 9 | t.string "name" 10 | t.string "type", limit: 50 11 | t.datetime "created_at" 12 | t.datetime "updated_at" 13 | end 14 | 15 | add_index "spree_configurations", ["name", "type"], name: "index_spree_configurations_on_name_and_type" 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180411082831_add_index_to_spree_stock_items_variant_id.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150216173445) 2 | class AddIndexToSpreeStockItemsVariantId < ActiveRecord::Migration[4.2] 3 | def up 4 | unless index_exists? :spree_stock_items, :variant_id 5 | add_index :spree_stock_items, :variant_id 6 | end 7 | end 8 | 9 | def down 10 | if index_exists? :spree_stock_items, :variant_id 11 | remove_index :spree_stock_items, :variant_id 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180411082832_ensure_payments_have_numbers.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150309161154) 2 | class EnsurePaymentsHaveNumbers < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_payments, :number unless index_exists?(:spree_payments, :number) 5 | Spree::Payment.where(number: nil).find_each do |payment| 6 | payment.generate_number 7 | payment.update_columns(number: payment.number) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082835_remove_user_index_from_spree_state_changes.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150324104002) 2 | class RemoveUserIndexFromSpreeStateChanges < ActiveRecord::Migration[4.2] 3 | def up 4 | if index_exists? :spree_state_changes, :user_id 5 | remove_index :spree_state_changes, :user_id 6 | end 7 | 8 | end 9 | 10 | def down 11 | unless index_exists? :spree_state_changes, :user_id 12 | add_index :spree_state_changes, :user_id 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180411082837_add_position_to_spree_payment_methods.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150522071831) 2 | class AddPositionToSpreePaymentMethods < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_payment_methods, :position, :integer, default: 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082838_add_deleted_at_to_friendly_id_slugs.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150522181728) 2 | class AddDeletedAtToFriendlyIdSlugs < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :friendly_id_slugs, :deleted_at, :datetime 5 | add_index :friendly_id_slugs, :deleted_at 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082841_migrate_payment_methods_display.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150627090949) 2 | class MigratePaymentMethodsDisplay < ActiveRecord::Migration[4.2] 3 | def change 4 | Spree::PaymentMethod.all.each do |method| 5 | if method.display_on.blank? 6 | method.display_on = "both" 7 | method.save 8 | end 9 | end 10 | 11 | change_column :spree_payment_methods, :display_on, :string, default: "both" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180411082842_enable_acts_as_paranoid_on_calculators.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150707204155) 2 | class EnableActsAsParanoidOnCalculators < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_calculators, :deleted_at, :datetime 5 | add_index :spree_calculators, :deleted_at 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082843_spree_payment_method_store_credits.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150714154102) 2 | class SpreePaymentMethodStoreCredits < ActiveRecord::Migration[4.2] 3 | def up 4 | # Reload to pick up new position column for acts_as_list 5 | Spree::PaymentMethod.reset_column_information 6 | Spree::PaymentMethod::StoreCredit.find_or_create_by(name: 'Store Credit', description: 'Store Credit', 7 | active: true, display_on: 'back_end') 8 | end 9 | 10 | def down 11 | Spree::PaymentMethod.find_by(type: 'Spree::PaymentMethod::StoreCredit', name: 'Store Credit').try(&:destroy) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180411082845_spree_store_credit_types.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20150727191614) 2 | class SpreeStoreCreditTypes < ActiveRecord::Migration[4.2] 3 | def up 4 | Spree::StoreCreditType.find_or_create_by(name: 'Expiring', priority: 1) 5 | Spree::StoreCreditType.find_or_create_by(name: 'Non-expiring', priority: 2) 6 | end 7 | 8 | def down 9 | Spree::StoreCreditType.find_by(name: 'Expiring').try(&:destroy) 10 | Spree::StoreCreditType.find_by(name: 'Non-expiring').try(&:destroy) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082847_remove_shipping_method_id_from_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20151220072838) 2 | class RemoveShippingMethodIdFromSpreeOrders < ActiveRecord::Migration[4.2] 3 | def up 4 | if column_exists?(:spree_orders, :shipping_method_id, :integer) 5 | remove_column :spree_orders, :shipping_method_id, :integer 6 | end 7 | end 8 | 9 | def down 10 | unless column_exists?(:spree_orders, :shipping_method_id, :integer) 11 | add_column :spree_orders, :shipping_method_id, :integer 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180411082849_add_indexes.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20160219165458) 2 | class AddIndexes < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_assets, :position 5 | add_index :spree_option_types, :name 6 | add_index :spree_option_values, :name 7 | add_index :spree_prices, :variant_id 8 | add_index :spree_properties, :name 9 | add_index :spree_roles, :name 10 | add_index :spree_shipping_categories, :name 11 | add_index :spree_taxons, :lft 12 | add_index :spree_taxons, :rgt 13 | add_index :spree_taxons, :name 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180411082850_remove_counter_cache_from_spree_variants_to_spree_stock_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20160509064646) 2 | class RemoveCounterCacheFromSpreeVariantsToSpreeStockItems < ActiveRecord::Migration[4.2] 3 | def up 4 | if column_exists?(:spree_variants, :stock_items_count) 5 | remove_column :spree_variants, :stock_items_count 6 | end 7 | end 8 | 9 | def down 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082852_change_collation_for_spree_tag_names.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20160511072249) 2 | # This migration is added to circumvent issue #623 and have special characters 3 | # work properly 4 | class ChangeCollationForSpreeTagNames < ActiveRecord::Migration[4.2] 5 | def up 6 | if ActsAsTaggableOn::Utils.using_mysql? 7 | execute("ALTER TABLE spree_tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082853_add_missing_indexes_to_spree_taggings.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20160511072335) 2 | class AddMissingIndexesToSpreeTaggings < ActiveRecord::Migration[4.2] 3 | def change 4 | add_index :spree_taggings, :tag_id 5 | add_index :spree_taggings, :taggable_id 6 | add_index :spree_taggings, :taggable_type 7 | add_index :spree_taggings, :tagger_id 8 | add_index :spree_taggings, :context 9 | 10 | add_index :spree_taggings, [:tagger_id, :tagger_type] 11 | add_index :spree_taggings, 12 | [:taggable_id, :taggable_type, :tagger_id, :context], 13 | name: "spree_taggings_idy" 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180411082854_add_zipcode_required_to_spree_countries.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20160608090604) 2 | class AddZipcodeRequiredToSpreeCountries < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_countries, :zipcode_required, :boolean, default: true 5 | Spree::Country.reset_column_information 6 | Spree::Country.where(iso: Spree::Address::NO_ZIPCODE_ISO_CODES).update_all(zipcode_required: false) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082855_add_created_at_to_variant.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20161014145148) 2 | class AddCreatedAtToVariant < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :spree_variants, :created_at, :datetime 5 | Spree::Variant.reset_column_information 6 | Spree::Variant.unscoped.where.not(updated_at: nil).update_all('created_at = updated_at') 7 | Spree::Variant.unscoped.where(updated_at: nil).update_all(created_at: Time.current, updated_at: Time.current) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082856_add_null_false_to_spree_variants_timestamps.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20161014152814) 2 | class AddNullFalseToSpreeVariantsTimestamps < ActiveRecord::Migration[5.0] 3 | def change 4 | change_column_null :spree_variants, :created_at, false 5 | change_column_null :spree_variants, :updated_at, false 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082857_add_quantity_to_inventory_units.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20161125065505) 2 | class AddQuantityToInventoryUnits < ActiveRecord::Migration[5.0] 3 | def change 4 | add_column :spree_inventory_units, :quantity, :integer, default: 1 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082859_add_unique_index_on_number_to_spree_orders.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170315152755) 2 | class AddUniqueIndexOnNumberToSpreeOrders < ActiveRecord::Migration[5.0] 3 | def change 4 | unless index_exists?(:spree_orders, :number, unique: true) 5 | numbers = Spree::Order.group(:number).having('sum(1) > 1').pluck(:number) 6 | orders = Spree::Order.where(number: numbers) 7 | 8 | orders.find_each do |order| 9 | order.number = order.class.number_generator.method(:generate_permalink).call(order.class) 10 | order.save 11 | end 12 | 13 | remove_index :spree_orders, :number if index_exists?(:spree_orders, :number) 14 | add_index :spree_orders, :number, unique: true 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180411082867_add_index_on_stock_location_to_spree_customer_returns.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170329110859) 2 | class AddIndexOnStockLocationToSpreeCustomerReturns < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_customer_returns, :stock_location_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082870_add_index_on_promotion_id_to_order_promotions.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170330132215) 2 | class AddIndexOnPromotionIdToOrderPromotions < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_order_promotions, :promotion_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082872_add_index_for_prototype_id_to_prototype_taxons.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331103334) 2 | class AddIndexForPrototypeIdToPrototypeTaxons < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_prototype_taxons, :prototype_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082873_add_indexes_to_refunds.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331110454) 2 | class AddIndexesToRefunds < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_refunds, :payment_id 5 | add_index :spree_refunds, :reimbursement_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082874_add_indexes_to_reimbursement_credits.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331111757) 2 | class AddIndexesToReimbursementCredits < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_reimbursement_credits, :reimbursement_id 5 | add_index :spree_reimbursement_credits, [:creditable_id, :creditable_type], name: 'index_reimbursement_credits_on_creditable_id_and_type' 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082875_add_indexes_to_return_authorizations.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331115246) 2 | class AddIndexesToReturnAuthorizations < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_return_authorizations, :order_id 5 | add_index :spree_return_authorizations, :stock_location_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082876_add_indexes_to_return_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331120125) 2 | class AddIndexesToReturnItems < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_return_items, :return_authorization_id 5 | add_index :spree_return_items, :inventory_unit_id 6 | add_index :spree_return_items, :reimbursement_id 7 | add_index :spree_return_items, :exchange_variant_id 8 | add_index :spree_return_items, :preferred_reimbursement_type_id 9 | add_index :spree_return_items, :override_reimbursement_type_id 10 | end 11 | end 12 | 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082877_add_index_to_role_users.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331121725) 2 | class AddIndexToRoleUsers < ActiveRecord::Migration[5.0] 3 | def change 4 | 5 | duplicates = Spree::RoleUser.group(:role_id, :user_id).having('sum(1) > 1').size 6 | 7 | duplicates.each do |f| 8 | role_id, user_id = f.first 9 | count = f.last - 1 # we want to leave one record 10 | roles = Spree::RoleUser.where(role_id: role_id, user_id: user_id).last(count) 11 | roles.map(&:destroy) 12 | end 13 | 14 | if index_exists? :spree_role_users, [:role_id, :user_id] 15 | remove_index :spree_role_users, [:role_id, :user_id] 16 | add_index :spree_role_users, [:role_id, :user_id], unique: true 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20180411082878_add_index_to_shipping_method_categories.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331123625) 2 | class AddIndexToShippingMethodCategories < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_shipping_method_categories, :shipping_category_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082880_add_index_to_spree_shipping_rates.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331124251) 2 | class AddIndexToSpreeShippingRates < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_shipping_rates, :shipment_id 5 | add_index :spree_shipping_rates, :shipping_method_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082881_add_index_to_spree_stock_items.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331124513) 2 | class AddIndexToSpreeStockItems < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_stock_items, :stock_location_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082882_add_index_to_spree_stock_movement.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170331124924) 2 | class AddIndexToSpreeStockMovement < ActiveRecord::Migration[5.0] 3 | def change 4 | add_index :spree_stock_movements, [:originator_id, :originator_type], name: 'index_stock_movements_on_originator_id_and_originator_type' 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082883_change_indexes_on_friendly_id_slugs.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170413211707) 2 | class ChangeIndexesOnFriendlyIdSlugs < ActiveRecord::Migration[5.0] 3 | def change 4 | # Updating indexes to reflect changes in friendly_id v5.2 5 | # See: https://github.com/norman/friendly_id/pull/694/commits/9f107f07ec9d2a58bda5a712b6e79a8d8013e0ab 6 | remove_index :friendly_id_slugs, [:slug, :sluggable_type] 7 | remove_index :friendly_id_slugs, [:slug, :sluggable_type, :scope] 8 | add_index :friendly_id_slugs, [:slug, :sluggable_type], length: { name: 100, slug: 20, sluggable_type: 20 } 9 | add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], length: { name: 100, slug: 20, sluggable_type: 20, scope: 20 }, unique: true 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082884_add_analytics_kind_to_spree_trackers.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170722102643) 2 | class AddAnalyticsKindToSpreeTrackers < ActiveRecord::Migration[5.1] 3 | def change 4 | add_column :spree_trackers, :kind, :integer, default: 0, null: false, index: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082885_rename_tracker_kind_field.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20170727103056) 2 | class RenameTrackerKindField < ActiveRecord::Migration[5.1] 3 | def change 4 | rename_column :spree_trackers, :kind, :engine 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180411082886_add_api_key_to_spree_users.spree_api.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_api (originally 20100107141738) 2 | class AddApiKeyToSpreeUsers < ActiveRecord::Migration[4.2] 3 | def change 4 | unless defined?(User) 5 | add_column :spree_users, :api_key, :string, limit: 40 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082887_resize_api_key_field.spree_api.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_api (originally 20120411123334) 2 | class ResizeApiKeyField < ActiveRecord::Migration[4.2] 3 | def change 4 | unless defined?(User) 5 | change_column :spree_users, :api_key, :string, limit: 48 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082888_rename_api_key_to_spree_api_key.spree_api.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_api (originally 20120530054546) 2 | class RenameApiKeyToSpreeApiKey < ActiveRecord::Migration[4.2] 3 | def change 4 | unless defined?(User) 5 | rename_column :spree_users, :api_key, :spree_api_key 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082889_add_index_to_user_spree_api_key.spree_api.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_api (originally 20131017162334) 2 | class AddIndexToUserSpreeApiKey < ActiveRecord::Migration[4.2] 3 | def change 4 | unless defined?(User) 5 | add_index :spree_users, :spree_api_key 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082892_convert_user_remember_field.spree_auth.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_auth (originally 20101214150824) 2 | class ConvertUserRememberField < SpreeExtension::Migration[4.2] 3 | def up 4 | remove_column :spree_users, :remember_created_at 5 | add_column :spree_users, :remember_created_at, :datetime 6 | end 7 | 8 | def down 9 | remove_column :spree_users, :remember_created_at 10 | add_column :spree_users, :remember_created_at, :string 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180411082893_add_reset_password_sent_at_to_spree_users.spree_auth.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_auth (originally 20120203010234) 2 | class AddResetPasswordSentAtToSpreeUsers < SpreeExtension::Migration[4.2] 3 | def change 4 | Spree::User.reset_column_information 5 | unless Spree::User.column_names.include?("reset_password_sent_at") 6 | add_column :spree_users, :reset_password_sent_at, :datetime 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180411082894_make_users_email_index_unique.spree_auth.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_auth (originally 20120605211305) 2 | class MakeUsersEmailIndexUnique < SpreeExtension::Migration[4.2] 3 | def up 4 | add_index "spree_users", ["email"], name: "email_idx_unique", unique: true 5 | end 6 | 7 | def down 8 | remove_index "spree_users", name: "email_idx_unique" 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082895_add_deleted_at_to_users.spree_auth.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_auth (originally 20140904000425) 2 | class AddDeletedAtToUsers < SpreeExtension::Migration[4.2] 3 | def change 4 | add_column :spree_users, :deleted_at, :datetime 5 | add_index :spree_users, :deleted_at 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180411082896_add_confirmable_to_users.spree_auth.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_auth (originally 20141002154641) 2 | class AddConfirmableToUsers < SpreeExtension::Migration[4.2] 3 | def change 4 | add_column :spree_users, :confirmation_token, :string 5 | add_column :spree_users, :confirmed_at, :datetime 6 | add_column :spree_users, :confirmation_sent_at, :datetime 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180411082897_add_missing_indices_on_user.spree_auth.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_auth (originally 20150416152553) 2 | class AddMissingIndicesOnUser < SpreeExtension::Migration[4.2] 3 | def change 4 | unless index_exists?(:spree_users, :bill_address_id) 5 | add_index :spree_users, :bill_address_id 6 | end 7 | unless index_exists?(:spree_users, :ship_address_id) 8 | add_index :spree_users, :ship_address_id 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180411082898_update_braintree_payment_method_type.spree_gateway.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_gateway (originally 20121017004102) 2 | class UpdateBraintreePaymentMethodType < SpreeExtension::Migration[4.2] 3 | def up 4 | Spree::PaymentMethod.where(:type => "Spree::Gateway::Braintree").update_all(:type => "Spree::Gateway::BraintreeGateway") 5 | end 6 | 7 | def down 8 | Spree::PaymentMethod.where(:type => "Spree::Gateway::BraintreeGateway").update_all(:type => "Spree::Gateway::Braintree") 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082899_update_stripe_payment_method_type.spree_gateway.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_gateway (originally 20130213222555) 2 | class UpdateStripePaymentMethodType < SpreeExtension::Migration[4.2] 3 | def up 4 | Spree::PaymentMethod.where(:type => "Spree::Gateway::Stripe").update_all(:type => "Spree::Gateway::StripeGateway") 5 | end 6 | 7 | def down 8 | Spree::PaymentMethod.where(:type => "Spree::Gateway::StripeGateway").update_all(:type => "Spree::Gateway::Stripe") 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082900_update_balanced_payment_method_type.spree_gateway.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_gateway (originally 20130415222802) 2 | class UpdateBalancedPaymentMethodType < SpreeExtension::Migration[4.2] 3 | def up 4 | Spree::PaymentMethod.where(:type => "Spree::Gateway::Balanced").update_all(:type => "Spree::Gateway::BalancedGateway") 5 | end 6 | 7 | def down 8 | Spree::PaymentMethod.where(:type => "Spree::Gateway::BalancedGateway").update_all(:type => "Spree::Gateway::Balanced") 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082901_update_paypal_payment_method_type.spree_gateway.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_gateway (originally 20131008221012) 2 | class UpdatePaypalPaymentMethodType < SpreeExtension::Migration[4.2] 3 | def up 4 | Spree::PaymentMethod.where(:type => "Spree::Gateway::PayPal").update_all(:type => "Spree::Gateway::PayPalGateway") 5 | end 6 | 7 | def down 8 | Spree::PaymentMethod.where(:type => "Spree::Gateway::PayPalGateway").update_all(:type => "Spree::Gateway::PayPal") 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180411082902_migrate_stripe_preferences.spree_gateway.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_gateway (originally 20131112133401) 2 | class MigrateStripePreferences < SpreeExtension::Migration[4.2] 3 | def up 4 | Spree::Preference.where("#{ActiveRecord::Base.connection.quote_column_name("key")} LIKE 'spree/gateway/stripe_gateway/login%'").each do |pref| 5 | pref.key = pref.key.gsub('login', 'secret_key') 6 | pref.save 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180416075149_create_identities.rb: -------------------------------------------------------------------------------- 1 | class CreateIdentities < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :identities do |t| 4 | t.integer :user_id 5 | t.string :provider, null: false 6 | t.string :uid, null: false 7 | 8 | t.timestamps null: false 9 | end 10 | 11 | add_index :identities, %i[uid provider], unique: true 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180423194846_create_table_favorites.spree_favorite_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_favorite_products (originally 20130705080641) 2 | class CreateTableFavorites < SpreeExtension::Migration[4.2] 3 | def change 4 | create_table :favorites do |t| 5 | t.integer :user_id 6 | t.integer :product_id 7 | t.timestamps null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180423194847_rename_favorites_to_spree_favorites.spree_favorite_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_favorite_products (originally 20130710105100) 2 | class RenameFavoritesToSpreeFavorites < SpreeExtension::Migration[4.2] 3 | def change 4 | rename_table :favorites, :spree_favorites 5 | add_index :spree_favorites, [:user_id, :product_id], unique: true 6 | add_index :spree_favorites, :user_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20180423194848_add_favorites_user_counts_to_product.spree_favorite_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_favorite_products (originally 20160304152800) 2 | class AddFavoritesUserCountsToProduct < SpreeExtension::Migration[4.2] 3 | def change 4 | add_column :spree_products, :favorite_users_count, :integer, default: 0 5 | add_index :spree_products, :favorite_users_count 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180426104709_create_spree_folders.spree_digital_assets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_digital_assets (originally 20160222135529) 2 | class CreateSpreeFolders < SpreeExtension::Migration[4.2] 3 | def change 4 | create_table :spree_folders do |t| 5 | t.string :name 6 | t.integer :parent_id, null: true, index: true 7 | t.integer :lft, null: false, index: true 8 | t.integer :rgt, null: false, index: true 9 | 10 | t.timestamps null: false 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180426104710_create_spree_digital_assets.spree_digital_assets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_digital_assets (originally 20160223071609) 2 | class CreateSpreeDigitalAssets < SpreeExtension::Migration[4.2] 3 | def change 4 | create_table :spree_digital_assets do |t| 5 | t.string :name 6 | t.attachment :attachment 7 | t.references :folder 8 | 9 | t.timestamps null: false 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180426104711_add_digital_asset_id_to_spree_assets.spree_digital_assets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_digital_assets (originally 20160308092647) 2 | class AddDigitalAssetIdToSpreeAssets < SpreeExtension::Migration[4.2] 3 | def change 4 | add_column :spree_assets, :digital_asset_id, :integer 5 | add_index :spree_assets, :digital_asset_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180426104712_add_approved_boolean_to_digital_assets.spree_digital_assets.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_digital_assets (originally 20171025100108) 2 | class AddApprovedBooleanToDigitalAssets < SpreeExtension::Migration[4.2] 3 | def change 4 | add_column :spree_digital_assets, :approved, :boolean, default: true, null: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180426184726_create_spree_permissions.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20130709104101) 2 | class CreateSpreePermissions < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_permissions do |t| 5 | t.string :title, null: false, unique: true 6 | t.integer :priority, default: 0 7 | t.boolean :visible, :boolean, default: true 8 | 9 | t.timestamps null: false 10 | end 11 | 12 | add_index :spree_permissions, :visible 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180426184727_create_spree_roles_permissions.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20130709104945) 2 | class CreateSpreeRolesPermissions < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_roles_permissions, id: false do |t| 5 | t.integer :role_id, null: false 6 | t.integer :permission_id, null: false 7 | end 8 | 9 | add_index(:spree_roles_permissions, :role_id) 10 | add_index(:spree_roles_permissions, :permission_id) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180426184728_add_editable_is_default_and_index_on_editable_is_default_and_name_to_spree_roles.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20130709105614) 2 | class AddEditableIsDefaultAndIndexOnEditableIsDefaultAndNameToSpreeRoles < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_roles, :editable, :boolean, default: true 5 | add_column :spree_roles, :is_default, :boolean, default: false 6 | 7 | add_index(:spree_roles, :is_default) 8 | add_index(:spree_roles, :editable) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180426184729_create_spree_permission_sets.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20170503090436) 2 | class CreateSpreePermissionSets < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_permission_sets do |t| 5 | t.string :name, null: false, unique: true 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180426184730_create_spree_roles_permission_sets.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20170503091013) 2 | class CreateSpreeRolesPermissionSets < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_roles_permission_sets do |t| 5 | t.references :role, index: true 6 | t.references :permission_set, index: true 7 | t.foreign_key :spree_roles, column: :role_id 8 | t.foreign_key :spree_permission_sets, column: :permission_set_id 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180426184731_create_spree_permissions_permission_sets.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20170503101648) 2 | class CreateSpreePermissionsPermissionSets < ActiveRecord::Migration[4.2] 3 | def change 4 | create_table :spree_permissions_permission_sets do |t| 5 | t.references :permission, index: true 6 | t.references :permission_set, index: true 7 | t.foreign_key :spree_permissions, column: :permission_id 8 | t.foreign_key :spree_permission_sets, column: :permission_set_id 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180426184732_add_description_to_permissions_and_permission_sets.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20170508082615) 2 | class AddDescriptionToPermissionsAndPermissionSets < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_permissions, :description, :string, default: '' 5 | add_column :spree_permission_sets, :description, :string, default: '' 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180426184733_add_display_boolean_to_permission_sets.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20170508082722) 2 | class AddDisplayBooleanToPermissionSets < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_permission_sets, :display_permission, :boolean, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180426184735_remove_column_boolean_from_permissions.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20170509082144) 2 | class RemoveColumnBooleanFromPermissions < ActiveRecord::Migration[4.2] 3 | def change 4 | remove_column :spree_permissions, :boolean, :boolean, default: true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180426184736_add_admin_boolean_to_roles.spree_admin_roles_and_access.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_admin_roles_and_access (originally 20170509090346) 2 | class AddAdminBooleanToRoles < ActiveRecord::Migration[4.2] 3 | def change 4 | add_column :spree_roles, :admin_accessible, :boolean, default: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180518103103_create_ckeditor_assets.rb: -------------------------------------------------------------------------------- 1 | class CreateCkeditorAssets < ActiveRecord::Migration[5.1] 2 | def self.up 3 | create_table :ckeditor_assets do |t| 4 | t.string :data_file_name, null: false 5 | t.string :data_content_type 6 | t.integer :data_file_size 7 | t.string :data_fingerprint 8 | t.string :type, limit: 30 9 | 10 | # Uncomment it to save images dimensions, if your need it 11 | t.integer :width 12 | t.integer :height 13 | 14 | t.timestamps null: false 15 | end 16 | 17 | add_index :ckeditor_assets, :type 18 | end 19 | 20 | def self.down 21 | drop_table :ckeditor_assets 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /db/migrate/20180527112844_create_relation_types.spree_related_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_related_products (originally 20100308090631) 2 | class CreateRelationTypes < SpreeExtension::Migration[4.2] 3 | def self.up 4 | create_table :relation_types do |t| 5 | t.string :name 6 | t.text :description 7 | t.string :applies_to 8 | t.timestamps 9 | end 10 | end 11 | 12 | def self.down 13 | drop_table :relation_types 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180527112845_create_relations.spree_related_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_related_products (originally 20100308092101) 2 | class CreateRelations < SpreeExtension::Migration[4.2] 3 | def self.up 4 | create_table :relations, force: true do |t| 5 | t.references :relation_type 6 | t.references :relatable, polymorphic: true 7 | t.references :related_to, polymorphic: true 8 | t.timestamps 9 | end 10 | end 11 | 12 | def self.down 13 | drop_table :relations 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180527112846_add_discount_to_relation.spree_related_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_related_products (originally 20100324123835) 2 | class AddDiscountToRelation < SpreeExtension::Migration[4.2] 3 | def self.up 4 | add_column :relations, :discount_amount, :decimal, precision: 8, scale: 2, default: 0.0 5 | end 6 | 7 | def self.down 8 | remove_column :relations, :discount_amount 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180527112847_prefixing_tables_with_spree.spree_related_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_related_products (originally 20111129044813) 2 | class PrefixingTablesWithSpree < SpreeExtension::Migration[4.2] 3 | def change 4 | rename_table :relation_types, :spree_relation_types 5 | rename_table :relations, :spree_relations 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180527112848_update_relation_types.spree_related_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_related_products (originally 20120208144454) 2 | class UpdateRelationTypes < SpreeExtension::Migration[4.2] 3 | def up 4 | Spree::RelationType.where(applies_to: 'Product').update_all(applies_to: 'Spree::Product') 5 | end 6 | 7 | def down 8 | Spree::RelationType.where(applies_to: 'Spree::Product').update_all(applies_to: 'Product') 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180527112849_update_relations.spree_related_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_related_products (originally 20120623014337) 2 | class UpdateRelations < SpreeExtension::Migration[4.2] 3 | def up 4 | Spree::Relation.where(relatable_type: 'Product').update_all(relatable_type: 'Spree::Product') 5 | Spree::Relation.where(related_to_type: 'Product').update_all(related_to_type: 'Spree::Product') 6 | end 7 | 8 | def down 9 | Spree::Relation.where(relatable_type: 'Spree::Product').update_all(relatable_type: 'Product') 10 | Spree::Relation.where(related_to_type: 'Spree::Product').update_all(related_to_type: 'Product') 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180527112850_add_position_to_spree_relations.spree_related_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_related_products (originally 20130727004612) 2 | class AddPositionToSpreeRelations < SpreeExtension::Migration[4.2] 3 | def change 4 | add_column :spree_relations, :position, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180527130706_create_reviews.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20081020220724) 2 | class CreateReviews < SpreeExtension::Migration[4.2] 3 | def self.up 4 | create_table :reviews do |t| 5 | t.integer :product_id 6 | t.string :name 7 | t.string :location 8 | t.integer :rating 9 | t.text :title 10 | t.text :review 11 | t.boolean :approved, default: false 12 | t.timestamps null: false 13 | end 14 | end 15 | 16 | def self.down 17 | drop_table :reviews 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20180527130707_create_feedback_reviews.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20101222083309) 2 | class CreateFeedbackReviews < SpreeExtension::Migration[4.2] 3 | def self.up 4 | create_table :feedback_reviews do |t| 5 | t.integer :user_id 6 | t.integer :review_id, null: false 7 | t.integer :rating, default: 0 8 | t.text :comment 9 | t.timestamps null: false 10 | end 11 | add_index :feedback_reviews, :review_id 12 | add_index :feedback_reviews, :user_id 13 | end 14 | 15 | def self.down 16 | drop_table :feedback_reviews 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20180527130709_add_user_to_reviews.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20110606150524) 2 | class AddUserToReviews < SpreeExtension::Migration[4.2] 3 | def self.up 4 | add_column :reviews, :user_id, :integer, null: true 5 | end 6 | 7 | def self.down 8 | remove_column :reviews, :user_id 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180527130710_add_ip_address_to_reviews.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20110806093221) 2 | class AddIpAddressToReviews < SpreeExtension::Migration[4.2] 3 | def self.up 4 | add_column :reviews, :ip_address, :string 5 | end 6 | 7 | def self.down 8 | remove_column :reviews, :ip_address 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180527130711_namespace_tables.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20120110172331) 2 | class NamespaceTables < SpreeExtension::Migration[4.2] 3 | def change 4 | rename_table :reviews, :spree_reviews 5 | rename_table :feedback_reviews, :spree_feedback_reviews 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180527130712_recalculate_ratings.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20120123141326) 2 | class RecalculateRatings < SpreeExtension::Migration[4.2] 3 | def up 4 | Spree::Product.reset_column_information 5 | Spree::Product.update_all reviews_count: 0 6 | Spree::Product.joins(:reviews).where('spree_reviews.id IS NOT NULL').find_each do |p| 7 | Spree::Product.update_counters p.id, reviews_count: p.reviews.approved.length 8 | # recalculate_product_rating exists on the review, not the product 9 | if p.reviews.approved.count > 0 10 | p.reviews.approved.first.recalculate_product_rating 11 | end 12 | end 13 | end 14 | 15 | def down 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180527130713_add_locale_to_reviews.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20120712182514) 2 | class AddLocaleToReviews < SpreeExtension::Migration[4.2] 3 | def self.up 4 | add_column :spree_reviews, :locale, :string, default: 'en' 5 | end 6 | 7 | def self.down 8 | remove_column :spree_reviews, :locale 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180527130714_add_locale_to_feedback_reviews.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20120712182627) 2 | class AddLocaleToFeedbackReviews < SpreeExtension::Migration[4.2] 3 | def self.up 4 | add_column :spree_feedback_reviews, :locale, :string, default: 'en' 5 | end 6 | 7 | def self.down 8 | remove_column :spree_feedback_reviews, :locale 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180527130715_add_show_identifier_to_reviews.spree_reviews.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_reviews (originally 20140703200946) 2 | class AddShowIdentifierToReviews < SpreeExtension::Migration[4.2] 3 | def change 4 | add_column :spree_reviews, :show_identifier, :boolean, default: true 5 | add_index :spree_reviews, :show_identifier 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180610043606_remove_indexes_from_spree_favorites.spree_favorite_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_favorite_products (originally 20180508000000) 2 | class RemoveIndexesFromSpreeFavorites < ActiveRecord::Migration[5.1] 3 | def change 4 | remove_index :spree_favorites, [:user_id, :product_id] 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180610043607_add_polymorphic_fields_to_spree_favorites.spree_favorite_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_favorite_products (originally 20180508074324) 2 | class AddPolymorphicFieldsToSpreeFavorites < ActiveRecord::Migration[5.1] 3 | def change 4 | add_reference(:spree_favorites, :favoritable, polymorphic: true, index: true) 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180610043608_remove_product_id_from_spree_favorites.spree_favorite_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_favorite_products (originally 20180508074838) 2 | class RemoveProductIdFromSpreeFavorites < ActiveRecord::Migration[5.1] 3 | def change 4 | remove_column :spree_favorites, :product_id, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180610043609_add_favorites_user_count_to_variant.spree_favorite_products.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_favorite_products (originally 20180508095945) 2 | class AddFavoritesUserCountToVariant < ActiveRecord::Migration[5.1] 3 | def change 4 | add_column :spree_variants, :favorite_users_count, :integer, default: 0 5 | add_index :spree_variants, :favorite_users_count 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180614042445_remove_icon_from_taxons.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20171004223836) 2 | class RemoveIconFromTaxons < ActiveRecord::Migration[5.1] 3 | def change 4 | remove_column :spree_taxons, :icon_file_name if column_exists? :spree_taxons, :icon_file_name 5 | remove_column :spree_taxons, :icon_content_type if column_exists? :spree_taxons, :icon_content_type 6 | remove_column :spree_taxons, :icon_file_size if column_exists? :spree_taxons, :icon_file_size 7 | remove_column :spree_taxons, :icon_updated_at if column_exists? :spree_taxons, :icon_updated_at 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180614042446_add_unique_index_on_spree_promotions_code.spree.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree (originally 20180222133746) 2 | class AddUniqueIndexOnSpreePromotionsCode < ActiveRecord::Migration[5.1] 3 | def change 4 | remove_index :spree_promotions, :code 5 | add_index :spree_promotions, :code, unique: true 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20180719070622_create_delivery_pincodes.rb: -------------------------------------------------------------------------------- 1 | class CreateDeliveryPincodes < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :delivery_pincodes do |t| 4 | t.string :pincode 5 | 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180801061208_create_spree_cart_events.spree_events_tracker.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_events_tracker (originally 20160313145434) 2 | class CreateSpreeCartEvents < SpreeExtension::Migration[4.2] 3 | def change 4 | create_table :spree_cart_events do |t| 5 | t.belongs_to :actor, polymorphic: true, index: true 6 | t.belongs_to :target, polymorphic: true, index: true 7 | t.string :activity 8 | t.string :referrer 9 | t.integer :quantity 10 | t.decimal :total, precision: 16, scale: 4 11 | t.string :session_id 12 | t.belongs_to :variant, index: true 13 | t.timestamps null: false 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180801061209_create_spree_page_events.spree_events_tracker.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_events_tracker (originally 20160314080710) 2 | class CreateSpreePageEvents < SpreeExtension::Migration[4.2] 3 | def change 4 | create_table :spree_page_events do |t| 5 | t.belongs_to :actor, polymorphic: true, index: true 6 | t.belongs_to :target, polymorphic: true, index: true 7 | t.string :activity 8 | t.string :referrer 9 | t.string :search_keywords 10 | t.string :session_id 11 | t.string :query_string 12 | t.timestamps null: false 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180801061210_create_spree_checkout_events.spree_events_tracker.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_events_tracker (originally 20160314080822) 2 | class CreateSpreeCheckoutEvents < SpreeExtension::Migration[4.2] 3 | def change 4 | create_table :spree_checkout_events do |t| 5 | t.belongs_to :actor, polymorphic: true, index: true 6 | t.belongs_to :target, polymorphic: true, index: true 7 | t.string :activity 8 | t.string :referrer 9 | t.string :previous_state 10 | t.string :next_state 11 | t.string :session_id 12 | t.timestamps null: false 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180801061211_change_query_string_to_text.spree_events_tracker.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_events_tracker (originally 20160710173455) 2 | class ChangeQueryStringToText < SpreeExtension::Migration[4.2] 3 | def up 4 | change_column :spree_page_events, :query_string, :text 5 | end 6 | 7 | def down 8 | # This might cause trouble if you have strings longer 9 | # than 255 characters. 10 | change_column :spree_page_events, :query_string, :string 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20180801061212_change_referrer_to_text_from_string.spree_events_tracker.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from spree_events_tracker (originally 20160710182337) 2 | class ChangeReferrerToTextFromString < SpreeExtension::Migration[4.2] 3 | def up 4 | change_column :spree_cart_events, :referrer, :text 5 | change_column :spree_page_events, :referrer, :text 6 | change_column :spree_checkout_events, :referrer, :text 7 | end 8 | 9 | def down 10 | # This might cause trouble if you have strings longer 11 | # than 255 characters. 12 | change_column :spree_cart_events, :referrer, :string 13 | change_column :spree_page_events, :referrer, :string 14 | change_column :spree_checkout_events, :referrer, :string 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | 9 | 10 | Spree::Core::Engine.load_seed if defined?(Spree::Core) 11 | Spree::Auth::Engine.load_seed if defined?(Spree::Auth) 12 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | angularspree-server: 4 | build: 5 | context: . 6 | dockerfile: ./.docker/development.dockerfile 7 | command: bin/rails server -p 3000 -b 0.0.0.0 8 | container_name: angularspree-server-start 9 | image: angularspree-server 10 | networks: 11 | - dev-network 12 | ports: 13 | - "3000:3000" 14 | volumes_from: 15 | - bundle 16 | volumes: 17 | - .:/home/app/angularspree-server 18 | 19 | bundle: 20 | image: angularspree-server 21 | volumes: 22 | - /bundle 23 | 24 | networks: 25 | dev-network: 26 | driver: bridge 27 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/lib/tasks/.keep -------------------------------------------------------------------------------- /lib/tasks/delivery_pincodes.rake: -------------------------------------------------------------------------------- 1 | namespace :delivery_pincodes do 2 | desc "Imports pincode from csv file." 3 | task import: :environment do 4 | require 'csv' 5 | data = [] 6 | CSV.foreach(Rails.root.join('public/uploads', 'shipment_pincodes.csv'), :headers => true) do |row| 7 | data << row.to_hash 8 | end 9 | p "Starting import" 10 | DeliveryPincode.import(data) 11 | p "Done!!" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/log/.keep -------------------------------------------------------------------------------- /new_setup.sh: -------------------------------------------------------------------------------- 1 | gem install bundler 2 | bundle 3 | rake db:reset 4 | rake spree_sample:load 5 | bundle exec rake spree_roles:permissions:populate 6 | bundle exec rake spree_roles:permissions:populate_permission_sets 7 | rails s 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angularspree-api", 3 | "private": true, 4 | "dependencies": {} 5 | } 6 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/test/controllers/.keep -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/delivery_pincodes.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | pincode: MyString 5 | 6 | two: 7 | pincode: MyString 8 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/test/fixtures/files/.keep -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/test/mailers/.keep -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/test/models/.keep -------------------------------------------------------------------------------- /test/models/delivery_pincode_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class DeliveryPincodeTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/test/system/.keep -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require_relative '../config/environment' 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/tmp/.keep -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aviabird/angularspree-api/7de8fcc8c5f53aa185959f15e44c0b4f4711f0af/vendor/assets/stylesheets/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/spree/backend/all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. 5 | * 6 | *= require spree/backend 7 | 8 | *= require_self 9 | *= require_tree . 10 | *= require admin/spree_favorite_products 11 | *= require spree/backend/spree_admin_roles_and_access 12 | *= require spree/backend/spree_editor 13 | *= require spree/backend/spree_events_tracker 14 | *= require spree/backend/spree_admin_insights 15 | *= require spree/backend/spree_analytics_trackers 16 | */ 17 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/spree/frontend/all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. 5 | * 6 | *= require spree/frontend 7 | 8 | *= require_self 9 | *= require_tree . 10 | *= require store/spree_favorite_products 11 | *= require spree/frontend/spree_admin_roles_and_access 12 | *= require spree/frontend/spree_reviews 13 | *= require spree/frontend/spree_events_tracker 14 | *= require spree/frontend/spree_admin_insights 15 | *= require spree/frontend/spree_analytics_trackers 16 | */ 17 | --------------------------------------------------------------------------------