solidus_friendly_promotions 1.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +61 -0
- data/.gem_release.yml +5 -0
- data/.github/stale.yml +1 -0
- data/.github_changelog_generator +2 -0
- data/.gitignore +21 -0
- data/.rspec +2 -0
- data/.rubocop.yml +29 -0
- data/.rubocop_todo.yml +157 -0
- data/.standard.yml +4 -0
- data/CHANGELOG.md +1 -0
- data/Gemfile +42 -0
- data/LICENSE +26 -0
- data/MIGRATING.md +134 -0
- data/README.md +144 -0
- data/Rakefile +7 -0
- data/app/assets/config/solidus_friendly_promotions/manifest.js +7 -0
- data/app/controllers/solidus_friendly_promotions/admin/base_controller.rb +54 -0
- data/app/controllers/solidus_friendly_promotions/admin/promotion_actions_controller.rb +103 -0
- data/app/controllers/solidus_friendly_promotions/admin/promotion_categories_controller.rb +13 -0
- data/app/controllers/solidus_friendly_promotions/admin/promotion_code_batches_controller.rb +30 -0
- data/app/controllers/solidus_friendly_promotions/admin/promotion_codes_controller.rb +58 -0
- data/app/controllers/solidus_friendly_promotions/admin/promotion_rules_controller.rb +105 -0
- data/app/controllers/solidus_friendly_promotions/admin/promotions_controller.rb +64 -0
- data/app/decorators/models/solidus_friendly_promotions/adjustment_decorator.rb +26 -0
- data/app/decorators/models/solidus_friendly_promotions/line_item_decorator.rb +7 -0
- data/app/decorators/models/solidus_friendly_promotions/order_decorator.rb +42 -0
- data/app/decorators/models/solidus_friendly_promotions/order_recalculator_decorator.rb +13 -0
- data/app/decorators/models/solidus_friendly_promotions/shipment_decorator.rb +14 -0
- data/app/decorators/models/solidus_friendly_promotions/shipping_rate_decorator.rb +29 -0
- data/app/helpers/solidus_friendly_promotions/admin/promotion_actions_helper.rb +23 -0
- data/app/helpers/solidus_friendly_promotions/admin/promotion_rules_helper.rb +25 -0
- data/app/javascript/solidus_friendly_promotions/controllers/application.js +9 -0
- data/app/javascript/solidus_friendly_promotions/controllers/calculator_tiers_controller.js +37 -0
- data/app/javascript/solidus_friendly_promotions/controllers/flash_controller.js +10 -0
- data/app/javascript/solidus_friendly_promotions/controllers/index.js +8 -0
- data/app/javascript/solidus_friendly_promotions/controllers/product_option_values_controller.js +62 -0
- data/app/javascript/solidus_friendly_promotions/jquery/option_value_picker.js +44 -0
- data/app/javascript/solidus_friendly_promotions.js +12 -0
- data/app/jobs/solidus_friendly_promotions/promotion_code_batch_job.rb +26 -0
- data/app/mailers/solidus_friendly_promotions/promotion_code_batch_mailer.rb +15 -0
- data/app/models/concerns/solidus_friendly_promotions/discountable_amount.rb +21 -0
- data/app/models/concerns/solidus_friendly_promotions/rules/line_item_applicable_order_rule.rb +23 -0
- data/app/models/concerns/solidus_friendly_promotions/rules/line_item_level_rule.rb +15 -0
- data/app/models/concerns/solidus_friendly_promotions/rules/order_level_rule.rb +15 -0
- data/app/models/concerns/solidus_friendly_promotions/rules/shipment_level_rule.rb +15 -0
- data/app/models/solidus_friendly_promotions/actions/adjust_line_item.rb +15 -0
- data/app/models/solidus_friendly_promotions/actions/adjust_line_item_quantity_groups.rb +116 -0
- data/app/models/solidus_friendly_promotions/actions/adjust_shipment.rb +15 -0
- data/app/models/solidus_friendly_promotions/calculators/distributed_amount.rb +37 -0
- data/app/models/solidus_friendly_promotions/calculators/flat_rate.rb +21 -0
- data/app/models/solidus_friendly_promotions/calculators/flexi_rate.rb +24 -0
- data/app/models/solidus_friendly_promotions/calculators/percent.rb +17 -0
- data/app/models/solidus_friendly_promotions/calculators/tiered_flat_rate.rb +56 -0
- data/app/models/solidus_friendly_promotions/calculators/tiered_percent.rb +66 -0
- data/app/models/solidus_friendly_promotions/distributed_amounts_handler.rb +43 -0
- data/app/models/solidus_friendly_promotions/eligibility_result.rb +5 -0
- data/app/models/solidus_friendly_promotions/eligibility_results.rb +48 -0
- data/app/models/solidus_friendly_promotions/friendly_promotion_adjuster/choose_discounts.rb +21 -0
- data/app/models/solidus_friendly_promotions/friendly_promotion_adjuster/discount_order.rb +76 -0
- data/app/models/solidus_friendly_promotions/friendly_promotion_adjuster/load_promotions.rb +54 -0
- data/app/models/solidus_friendly_promotions/friendly_promotion_adjuster/persist_discounted_order.rb +81 -0
- data/app/models/solidus_friendly_promotions/friendly_promotion_adjuster.rb +25 -0
- data/app/models/solidus_friendly_promotions/item_discount.rb +21 -0
- data/app/models/solidus_friendly_promotions/migration_support/order_promotion_syncer.rb +54 -0
- data/app/models/solidus_friendly_promotions/order_promotion.rb +23 -0
- data/app/models/solidus_friendly_promotions/permission_sets/friendly_promotion_management.rb +15 -0
- data/app/models/solidus_friendly_promotions/products_promotion_rule.rb +8 -0
- data/app/models/solidus_friendly_promotions/promotion.rb +166 -0
- data/app/models/solidus_friendly_promotions/promotion_action.rb +73 -0
- data/app/models/solidus_friendly_promotions/promotion_category.rb +9 -0
- data/app/models/solidus_friendly_promotions/promotion_code/batch_builder.rb +72 -0
- data/app/models/solidus_friendly_promotions/promotion_code.rb +55 -0
- data/app/models/solidus_friendly_promotions/promotion_code_batch.rb +25 -0
- data/app/models/solidus_friendly_promotions/promotion_handler/coupon.rb +113 -0
- data/app/models/solidus_friendly_promotions/promotion_handler/page.rb +30 -0
- data/app/models/solidus_friendly_promotions/promotion_rule.rb +55 -0
- data/app/models/solidus_friendly_promotions/promotion_rules_store.rb +8 -0
- data/app/models/solidus_friendly_promotions/promotion_rules_taxon.rb +8 -0
- data/app/models/solidus_friendly_promotions/promotion_rules_user.rb +8 -0
- data/app/models/solidus_friendly_promotions/rules/discounted_item_total.rb +22 -0
- data/app/models/solidus_friendly_promotions/rules/first_order.rb +31 -0
- data/app/models/solidus_friendly_promotions/rules/first_repeat_purchase_since.rb +31 -0
- data/app/models/solidus_friendly_promotions/rules/item_total.rb +86 -0
- data/app/models/solidus_friendly_promotions/rules/line_item_option_value.rb +37 -0
- data/app/models/solidus_friendly_promotions/rules/line_item_product.rb +52 -0
- data/app/models/solidus_friendly_promotions/rules/line_item_taxon.rb +55 -0
- data/app/models/solidus_friendly_promotions/rules/minimum_quantity.rb +48 -0
- data/app/models/solidus_friendly_promotions/rules/nth_order.rb +40 -0
- data/app/models/solidus_friendly_promotions/rules/one_use_per_user.rb +25 -0
- data/app/models/solidus_friendly_promotions/rules/option_value.rb +28 -0
- data/app/models/solidus_friendly_promotions/rules/product.rb +85 -0
- data/app/models/solidus_friendly_promotions/rules/shipping_method.rb +19 -0
- data/app/models/solidus_friendly_promotions/rules/store.rb +26 -0
- data/app/models/solidus_friendly_promotions/rules/taxon.rb +98 -0
- data/app/models/solidus_friendly_promotions/rules/user.rb +35 -0
- data/app/models/solidus_friendly_promotions/rules/user_logged_in.rb +16 -0
- data/app/models/solidus_friendly_promotions/rules/user_role.rb +42 -0
- data/app/models/solidus_friendly_promotions/shipping_rate_discount.rb +11 -0
- data/app/models/solidus_friendly_promotions/simple_order_contents.rb +27 -0
- data/app/models/solidus_friendly_promotions.rb +7 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/_calculator_select.html.erb +16 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/_form.html.erb +3 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/_promotion_action.html.erb +29 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/_type_select.html.erb +14 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/actions/_adjust_line_item.html.erb +6 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/actions/_adjust_line_item_quantity_groups.html.erb +13 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/actions/_adjust_shipment.html.erb +6 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/actions/_calculator_fields.erb +8 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/_default_fields.html.erb +6 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/distributed_amount/_fields.html.erb +56 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/flat_rate/_fields.html.erb +6 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_flat_rate/_fields.html.erb +34 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_flat_rate/_tier_fields.html.erb +32 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_percent/_fields.html.erb +34 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_percent/_tier_fields.html.erb +32 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/edit.html.erb +23 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_actions/new.html.erb +26 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_categories/_form.html.erb +14 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_categories/edit.html.erb +10 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_categories/index.html.erb +47 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_categories/new.html.erb +10 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_codes/index.csv.ruby +8 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_codes/index.html.erb +32 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_codes/new.html.erb +31 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/_promotion_rule.html.erb +22 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/_type_select.html.erb +20 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/new.html.erb +24 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_first_order.html.erb +3 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_first_repeat_purchase_since.html.erb +6 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_item_total.html.erb +17 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_line_item_option_value.html.erb +25 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_line_item_product.html.erb +21 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_line_item_taxon.html.erb +17 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_minimum_quantity.html.erb +5 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_nth_order.html.erb +15 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_one_use_per_user.html.erb +3 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_option_value.html.erb +63 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_product.html.erb +44 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_shipping_method.html.erb +10 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_store.html.erb +9 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_taxon.html.erb +44 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_user.html.erb +7 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_user_logged_in.html.erb +3 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_user_role.html.erb +15 -0
- data/app/views/solidus_friendly_promotions/admin/promotion_rules/rules/line_item_option_value/_option_value_fields.html.erb +17 -0
- data/app/views/solidus_friendly_promotions/admin/promotions/_activations_edit.html.erb +22 -0
- data/app/views/solidus_friendly_promotions/admin/promotions/_activations_new.html.erb +43 -0
- data/app/views/solidus_friendly_promotions/admin/promotions/_form.html.erb +96 -0
- data/app/views/solidus_friendly_promotions/admin/promotions/edit.html.erb +73 -0
- data/app/views/solidus_friendly_promotions/admin/promotions/index.html.erb +124 -0
- data/app/views/solidus_friendly_promotions/admin/promotions/new.html.erb +9 -0
- data/app/views/solidus_friendly_promotions/admin/shared/_promotion_sub_menu.html.erb +14 -0
- data/app/views/solidus_friendly_promotions/promotion_code_batch_mailer/promotion_code_batch_errored.text.erb +2 -0
- data/app/views/solidus_friendly_promotions/promotion_code_batch_mailer/promotion_code_batch_finished.text.erb +2 -0
- data/bin/console +17 -0
- data/bin/importmap +4 -0
- data/bin/rails +7 -0
- data/bin/rails-engine +13 -0
- data/bin/rails-sandbox +16 -0
- data/bin/rake +7 -0
- data/bin/sandbox +75 -0
- data/bin/setup +8 -0
- data/config/importmap.rb +12 -0
- data/config/initializers/solidus_friendly_promotions.rb +3 -0
- data/config/locales/en.yml +255 -0
- data/config/routes.rb +18 -0
- data/db/migrate/20230703101637_create_promotions.rb +16 -0
- data/db/migrate/20230703141116_create_promotion_categories.rb +14 -0
- data/db/migrate/20230703143943_create_promotion_rules.rb +12 -0
- data/db/migrate/20230704083830_add_rule_tables.rb +31 -0
- data/db/migrate/20230704093625_create_promotion_actions.rb +14 -0
- data/db/migrate/20230704102444_create_promotion_codes.rb +11 -0
- data/db/migrate/20230704102656_create_promotion_code_batches.rb +33 -0
- data/db/migrate/20230705171556_create_friendly_order_promotions.rb +11 -0
- data/db/migrate/20230725074235_create_shipping_rate_discounts.rb +12 -0
- data/db/migrate/20230928093138_add_lane_to_solidus_friendly_promotions_promotions.rb +5 -0
- data/db/migrate/20231006134042_add_customer_label_to_promotions.rb +7 -0
- data/db/migrate/20231011100059_add_db_comments_to_friendly_order_promotions.rb +61 -0
- data/db/migrate/20231011120928_add_db_comments_to_friendly_promotion_rules_taxons.rb +54 -0
- data/db/migrate/20231011131324_add_db_comments_to_friendly_promotion_rules.rb +60 -0
- data/db/migrate/20231011142040_add_db_comments_to_friendly_promotion_rules_users.rb +53 -0
- data/db/migrate/20231011154553_allow_null_promotion_ids.rb +9 -0
- data/db/migrate/20231011155822_add_db_comments_to_friendly_promotions.rb +123 -0
- data/db/migrate/20231011163030_add_db_comments_to_friendly_promotion_codes.rb +60 -0
- data/db/migrate/20231011173312_add_db_comments_to_friendly_promotion_code_batches.rb +91 -0
- data/db/migrate/20231011184205_add_db_comments_to_friendly_promotion_rules_stores.rb +53 -0
- data/db/migrate/20231011190222_add_db_comments_to_friendly_promotion_actions.rb +68 -0
- data/db/migrate/20231012020928_add_db_comments_to_friendly_products_promotion_rules.rb +52 -0
- data/db/migrate/20231012120928_add_db_comments_to_friendly_promotion_categories.rb +52 -0
- data/db/migrate/20231013181921_add_original_promotion_ids.rb +6 -0
- data/lib/generators/solidus_friendly_promotions/install/install_generator.rb +38 -0
- data/lib/generators/solidus_friendly_promotions/install/templates/initializer.rb +118 -0
- data/lib/solidus_friendly_promotions/configuration.rb +52 -0
- data/lib/solidus_friendly_promotions/engine.rb +37 -0
- data/lib/solidus_friendly_promotions/migrate_adjustments.rb +62 -0
- data/lib/solidus_friendly_promotions/migrate_order_promotions.rb +73 -0
- data/lib/solidus_friendly_promotions/nested_class_set.rb +24 -0
- data/lib/solidus_friendly_promotions/promotion_map.rb +96 -0
- data/lib/solidus_friendly_promotions/promotion_migrator.rb +103 -0
- data/lib/solidus_friendly_promotions/testing_support/factories/friendly_order_factory.rb +20 -0
- data/lib/solidus_friendly_promotions/testing_support/factories/friendly_order_promotion_factory.rb +8 -0
- data/lib/solidus_friendly_promotions/testing_support/factories/friendly_promotion_category_factory.rb +7 -0
- data/lib/solidus_friendly_promotions/testing_support/factories/friendly_promotion_code_factory.rb +8 -0
- data/lib/solidus_friendly_promotions/testing_support/factories/friendly_promotion_factory.rb +91 -0
- data/lib/solidus_friendly_promotions/testing_support/factories/friendly_shipping_rate_discount_factory.rb +14 -0
- data/lib/solidus_friendly_promotions/testing_support.rb +9 -0
- data/lib/solidus_friendly_promotions/version.rb +5 -0
- data/lib/solidus_friendly_promotions.rb +18 -0
- data/lib/tasks/solidus_friendly_promotions/migrate_adjustments.rake +17 -0
- data/lib/tasks/solidus_friendly_promotions/migrate_existing_promotions.rake +12 -0
- data/lib/tasks/solidus_friendly_promotions/migrate_order_promotions.rake +17 -0
- data/solidus_friendly_promotions.gemspec +40 -0
- metadata +392 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyOrderPromotions < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_order_promotions, friendly_order_promotions_table_comment)
|
7
|
+
change_column_comment(:friendly_order_promotions, :order_id, order_id_comment)
|
8
|
+
change_column_comment(:friendly_order_promotions, :promotion_id, promotion_id_comment)
|
9
|
+
change_column_comment(:friendly_order_promotions, :promotion_code_id, promotion_code_id_comment)
|
10
|
+
change_column_comment(:friendly_order_promotions, :id, id_comment)
|
11
|
+
change_column_comment(:friendly_order_promotions, :created_at, created_at_comment)
|
12
|
+
change_column_comment(:friendly_order_promotions, :updated_at, updated_at_comment)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def friendly_order_promotions_table_comment
|
19
|
+
<<~COMMENT
|
20
|
+
Join table between spree_orders and friendly_promotions. One of two places that record whether a promotion is linked to an order.
|
21
|
+
The other place is the spree_adjustments table which records promotion code IDs and could be both eligible and ineligible.
|
22
|
+
An entry here is created every time a promotion is linked to an order.
|
23
|
+
COMMENT
|
24
|
+
end
|
25
|
+
|
26
|
+
def order_id_comment
|
27
|
+
<<~COMMENT
|
28
|
+
Foreign key to the spree_orders table.
|
29
|
+
COMMENT
|
30
|
+
end
|
31
|
+
|
32
|
+
def promotion_id_comment
|
33
|
+
<<~COMMENT
|
34
|
+
Foreign key to the friendly_promotions table.
|
35
|
+
COMMENT
|
36
|
+
end
|
37
|
+
|
38
|
+
def promotion_code_id_comment
|
39
|
+
<<~COMMENT
|
40
|
+
Foreign key to the friendly_promotion_codes table. If a promotion code was used, records the promotion code.
|
41
|
+
COMMENT
|
42
|
+
end
|
43
|
+
|
44
|
+
def id_comment
|
45
|
+
<<~COMMENT
|
46
|
+
Primary key of this table.
|
47
|
+
COMMENT
|
48
|
+
end
|
49
|
+
|
50
|
+
def created_at_comment
|
51
|
+
<<~COMMENT
|
52
|
+
Timestamp indicating when this record was created.
|
53
|
+
COMMENT
|
54
|
+
end
|
55
|
+
|
56
|
+
def updated_at_comment
|
57
|
+
<<~COMMENT
|
58
|
+
Timestamp indicating when this record was last updated.
|
59
|
+
COMMENT
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyPromotionRulesTaxons < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_promotion_rules_taxons, friendly_promotion_rules_taxons_table_comment)
|
7
|
+
change_column_comment(:friendly_promotion_rules_taxons, :id, id_comment)
|
8
|
+
change_column_comment(:friendly_promotion_rules_taxons, :taxon_id, taxon_id_comment)
|
9
|
+
change_column_comment(:friendly_promotion_rules_taxons, :promotion_rule_id, promotion_rule_id_comment)
|
10
|
+
change_column_comment(:friendly_promotion_rules_taxons, :created_at, created_at_comment)
|
11
|
+
change_column_comment(:friendly_promotion_rules_taxons, :updated_at, updated_at_comment)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def friendly_promotion_rules_taxons_table_comment
|
18
|
+
<<~COMMENT
|
19
|
+
Join table between promotion rules and taxons. Only used if the promotion rule's type is SolidusFriendlyPromotion::Rules::Taxon or
|
20
|
+
SolidusFriendlyPromotion::Rules::LineItemTaxon. Represents those taxons that the promotion rule matches on using its any/all/none
|
21
|
+
or include/exclude match policy.
|
22
|
+
COMMENT
|
23
|
+
end
|
24
|
+
|
25
|
+
def id_comment
|
26
|
+
<<~COMMENT
|
27
|
+
Primary key of this table.
|
28
|
+
COMMENT
|
29
|
+
end
|
30
|
+
|
31
|
+
def taxon_id_comment
|
32
|
+
<<~COMMENT
|
33
|
+
Foreign key to the taxons table.
|
34
|
+
COMMENT
|
35
|
+
end
|
36
|
+
|
37
|
+
def promotion_rule_id_comment
|
38
|
+
<<~COMMENT
|
39
|
+
Foreign key to the friendly_promotion_rules table.
|
40
|
+
COMMENT
|
41
|
+
end
|
42
|
+
|
43
|
+
def created_at_comment
|
44
|
+
<<~COMMENT
|
45
|
+
Timestamp indicating when this record was created.
|
46
|
+
COMMENT
|
47
|
+
end
|
48
|
+
|
49
|
+
def updated_at_comment
|
50
|
+
<<~COMMENT
|
51
|
+
Timestamp indicating when this record was last updated.
|
52
|
+
COMMENT
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyPromotionRules < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_promotion_rules, friendly_promotion_rules_table_comment)
|
7
|
+
change_column_comment(:friendly_promotion_rules, :id, id_comment)
|
8
|
+
change_column_comment(:friendly_promotion_rules, :promotion_id, promotion_id_comment)
|
9
|
+
change_column_comment(:friendly_promotion_rules, :type, type_comment)
|
10
|
+
change_column_comment(:friendly_promotion_rules, :created_at, created_at_comment)
|
11
|
+
change_column_comment(:friendly_promotion_rules, :updated_at, updated_at_comment)
|
12
|
+
change_column_comment(:friendly_promotion_rules, :preferences, preferences_comment)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def friendly_promotion_rules_table_comment
|
19
|
+
<<~COMMENT
|
20
|
+
Represents promotion rules. A promotion may have many rules, which determine whether the promotion is eligible.
|
21
|
+
All rules must be eligible for the promotion to be eligible. If there are no rules, the promotion is always eligible.
|
22
|
+
COMMENT
|
23
|
+
end
|
24
|
+
|
25
|
+
def id_comment
|
26
|
+
<<~COMMENT
|
27
|
+
Primary key of this table.
|
28
|
+
COMMENT
|
29
|
+
end
|
30
|
+
|
31
|
+
def promotion_id_comment
|
32
|
+
<<~COMMENT
|
33
|
+
Foreign key to the promotions table.
|
34
|
+
COMMENT
|
35
|
+
end
|
36
|
+
|
37
|
+
def type_comment
|
38
|
+
<<~COMMENT
|
39
|
+
STI column. This represents which Ruby class to load when an entry of this table is loaded in Rails.
|
40
|
+
COMMENT
|
41
|
+
end
|
42
|
+
|
43
|
+
def created_at_comment
|
44
|
+
<<~COMMENT
|
45
|
+
Timestamp indicating when this record was created.
|
46
|
+
COMMENT
|
47
|
+
end
|
48
|
+
|
49
|
+
def updated_at_comment
|
50
|
+
<<~COMMENT
|
51
|
+
Timestamp indicating when this record was last updated.
|
52
|
+
COMMENT
|
53
|
+
end
|
54
|
+
|
55
|
+
def preferences_comment
|
56
|
+
<<~COMMENT
|
57
|
+
Preferences for this promotion rule. Serialized YAML column with preferences for this promotion rule.
|
58
|
+
COMMENT
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyPromotionRulesUsers < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_promotion_rules_users, friendly_promotion_rules_users_table_comment)
|
7
|
+
change_column_comment(:friendly_promotion_rules_users, :user_id, user_id_comment)
|
8
|
+
change_column_comment(:friendly_promotion_rules_users, :promotion_rule_id, promotion_rule_id_comment)
|
9
|
+
change_column_comment(:friendly_promotion_rules_users, :id, id_comment)
|
10
|
+
change_column_comment(:friendly_promotion_rules_users, :created_at, created_at_comment)
|
11
|
+
change_column_comment(:friendly_promotion_rules_users, :updated_at, updated_at_comment)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def friendly_promotion_rules_users_table_comment
|
18
|
+
<<~COMMENT
|
19
|
+
Join table between promotion rules and users. Used with promotion rules of type "SolidusFriendlyPromotions::Rules::User".
|
20
|
+
An entry here indicates that a promotion is eligible for the user ID specified here.
|
21
|
+
COMMENT
|
22
|
+
end
|
23
|
+
|
24
|
+
def user_id_comment
|
25
|
+
<<~COMMENT
|
26
|
+
Foreign key to the users table.
|
27
|
+
COMMENT
|
28
|
+
end
|
29
|
+
|
30
|
+
def promotion_rule_id_comment
|
31
|
+
<<~COMMENT
|
32
|
+
Foreign key to the promotion_rules table.
|
33
|
+
COMMENT
|
34
|
+
end
|
35
|
+
|
36
|
+
def id_comment
|
37
|
+
<<~COMMENT
|
38
|
+
Primary key of this table.
|
39
|
+
COMMENT
|
40
|
+
end
|
41
|
+
|
42
|
+
def created_at_comment
|
43
|
+
<<~COMMENT
|
44
|
+
Timestamp indicating when this record was created.
|
45
|
+
COMMENT
|
46
|
+
end
|
47
|
+
|
48
|
+
def updated_at_comment
|
49
|
+
<<~COMMENT
|
50
|
+
Timestamp indicating when this record was last updated.
|
51
|
+
COMMENT
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyPromotions < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_promotions, friendly_promotions_table_comment)
|
7
|
+
change_column_comment(:friendly_promotions, :id, id_comment)
|
8
|
+
change_column_comment(:friendly_promotions, :description, description_comment)
|
9
|
+
change_column_comment(:friendly_promotions, :expires_at, expires_at_comment)
|
10
|
+
change_column_comment(:friendly_promotions, :starts_at, starts_at_comment)
|
11
|
+
change_column_comment(:friendly_promotions, :customer_label, customer_label_comment)
|
12
|
+
change_column_comment(:friendly_promotions, :usage_limit, usage_limit_comment)
|
13
|
+
change_column_comment(:friendly_promotions, :advertise, advertise_comment)
|
14
|
+
change_column_comment(:friendly_promotions, :path, path_comment)
|
15
|
+
change_column_comment(:friendly_promotions, :lane, lane_comment)
|
16
|
+
change_column_comment(:friendly_promotions, :name, name_comment)
|
17
|
+
change_column_comment(:friendly_promotions, :created_at, created_at_comment)
|
18
|
+
change_column_comment(:friendly_promotions, :updated_at, updated_at_comment)
|
19
|
+
change_column_comment(:friendly_promotions, :promotion_category_id, promotion_category_id_comment)
|
20
|
+
change_column_comment(:friendly_promotions, :per_code_usage_limit, per_code_usage_limit_comment)
|
21
|
+
change_column_comment(:friendly_promotions, :apply_automatically, apply_automatically_comment)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def friendly_promotions_table_comment
|
28
|
+
<<~COMMENT
|
29
|
+
Promotions are sets of rules and actions to discount (parts of) an order.
|
30
|
+
COMMENT
|
31
|
+
end
|
32
|
+
|
33
|
+
def id_comment
|
34
|
+
<<~COMMENT
|
35
|
+
Primary key of this table.
|
36
|
+
COMMENT
|
37
|
+
end
|
38
|
+
|
39
|
+
def description_comment
|
40
|
+
<<~COMMENT
|
41
|
+
The description of this promotion.
|
42
|
+
COMMENT
|
43
|
+
end
|
44
|
+
|
45
|
+
def expires_at_comment
|
46
|
+
<<~COMMENT
|
47
|
+
Timestamp at which the promotion stops being eligible.
|
48
|
+
COMMENT
|
49
|
+
end
|
50
|
+
|
51
|
+
def starts_at_comment
|
52
|
+
<<~COMMENT
|
53
|
+
Timestamp at which the promotion starts being eligible.
|
54
|
+
COMMENT
|
55
|
+
end
|
56
|
+
|
57
|
+
def customer_label_comment
|
58
|
+
<<~COMMENT
|
59
|
+
The contents of this field will be replicated in the labels of adjustments created with it.
|
60
|
+
COMMENT
|
61
|
+
end
|
62
|
+
|
63
|
+
def name_comment
|
64
|
+
<<~COMMENT
|
65
|
+
Admin name of the promotion.
|
66
|
+
COMMENT
|
67
|
+
end
|
68
|
+
|
69
|
+
def usage_limit_comment
|
70
|
+
<<~COMMENT
|
71
|
+
How many times this promotion can be applied to orders globally.
|
72
|
+
COMMENT
|
73
|
+
end
|
74
|
+
|
75
|
+
def advertise_comment
|
76
|
+
<<~COMMENT
|
77
|
+
Marks a promotion as advertised.
|
78
|
+
COMMENT
|
79
|
+
end
|
80
|
+
|
81
|
+
def path_comment
|
82
|
+
<<~COMMENT
|
83
|
+
This could be used for applying a promotion based on a route the customer visits.
|
84
|
+
COMMENT
|
85
|
+
end
|
86
|
+
|
87
|
+
def lane_comment
|
88
|
+
<<~COMMENT
|
89
|
+
Priority lane of this promotion.
|
90
|
+
COMMENT
|
91
|
+
end
|
92
|
+
|
93
|
+
def created_at_comment
|
94
|
+
<<~COMMENT
|
95
|
+
Timestamp indicating when this record was created.
|
96
|
+
COMMENT
|
97
|
+
end
|
98
|
+
|
99
|
+
def updated_at_comment
|
100
|
+
<<~COMMENT
|
101
|
+
Timestamp indicating when this record was last updated.
|
102
|
+
COMMENT
|
103
|
+
end
|
104
|
+
|
105
|
+
def promotion_category_id_comment
|
106
|
+
<<~COMMENT
|
107
|
+
Foreign key to the friendly_promotion_categories table.
|
108
|
+
COMMENT
|
109
|
+
end
|
110
|
+
|
111
|
+
def per_code_usage_limit_comment
|
112
|
+
<<~COMMENT
|
113
|
+
How many times this promotion can be used per promotion code.
|
114
|
+
COMMENT
|
115
|
+
end
|
116
|
+
|
117
|
+
def apply_automatically_comment
|
118
|
+
<<~COMMENT
|
119
|
+
Whether this promotion applies automatically in the cart, as opposed to the promotion being activated through a promotion code
|
120
|
+
or a path (see above).
|
121
|
+
COMMENT
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyPromotionCodes < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_promotion_codes, friendly_promotion_codes_table_comment)
|
7
|
+
change_column_comment(:friendly_promotion_codes, :id, id_comment)
|
8
|
+
change_column_comment(:friendly_promotion_codes, :promotion_id, promotion_id_comment)
|
9
|
+
change_column_comment(:friendly_promotion_codes, :value, value_comment)
|
10
|
+
change_column_comment(:friendly_promotion_codes, :created_at, created_at_comment)
|
11
|
+
change_column_comment(:friendly_promotion_codes, :updated_at, updated_at_comment)
|
12
|
+
change_column_comment(:friendly_promotion_codes, :promotion_code_batch_id, promotion_code_batch_id_comment)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def friendly_promotion_codes_table_comment
|
19
|
+
<<~COMMENT
|
20
|
+
Promotions can have many promotion codes. This table is a collection of those codes.
|
21
|
+
COMMENT
|
22
|
+
end
|
23
|
+
|
24
|
+
def id_comment
|
25
|
+
<<~COMMENT
|
26
|
+
Primary key of this table.
|
27
|
+
COMMENT
|
28
|
+
end
|
29
|
+
|
30
|
+
def promotion_id_comment
|
31
|
+
<<~COMMENT
|
32
|
+
Foreign key to the friendly_promotions table.
|
33
|
+
COMMENT
|
34
|
+
end
|
35
|
+
|
36
|
+
def value_comment
|
37
|
+
<<~COMMENT
|
38
|
+
The actual code, such as "BOATLIFE" for example.
|
39
|
+
COMMENT
|
40
|
+
end
|
41
|
+
|
42
|
+
def created_at_comment
|
43
|
+
<<~COMMENT
|
44
|
+
Timestamp indicating when this record was created.
|
45
|
+
COMMENT
|
46
|
+
end
|
47
|
+
|
48
|
+
def updated_at_comment
|
49
|
+
<<~COMMENT
|
50
|
+
Timestamp indicating when this record was last updated.
|
51
|
+
COMMENT
|
52
|
+
end
|
53
|
+
|
54
|
+
def promotion_code_batch_id_comment
|
55
|
+
<<~COMMENT
|
56
|
+
Foreign key to the friendly_promotion_code_batches table.
|
57
|
+
If this promotion code was created using a promotion code batch, links to the batch.
|
58
|
+
COMMENT
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyPromotionCodeBatches < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_promotion_code_batches, friendly_promotion_code_batches_table_comment)
|
7
|
+
change_column_comment(:friendly_promotion_code_batches, :id, id_comment)
|
8
|
+
change_column_comment(:friendly_promotion_code_batches, :promotion_id, promotion_id_comment)
|
9
|
+
change_column_comment(:friendly_promotion_code_batches, :base_code, base_code_comment)
|
10
|
+
change_column_comment(:friendly_promotion_code_batches, :number_of_codes, number_of_codes_comment)
|
11
|
+
change_column_comment(:friendly_promotion_code_batches, :email, email_comment)
|
12
|
+
change_column_comment(:friendly_promotion_code_batches, :error, error_comment)
|
13
|
+
change_column_comment(:friendly_promotion_code_batches, :state, state_comment)
|
14
|
+
change_column_comment(:friendly_promotion_code_batches, :created_at, created_at_comment)
|
15
|
+
change_column_comment(:friendly_promotion_code_batches, :updated_at, updated_at_comment)
|
16
|
+
change_column_comment(:friendly_promotion_code_batches, :join_characters, join_characters_comment)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def friendly_promotion_code_batches_table_comment
|
23
|
+
<<~COMMENT
|
24
|
+
We allow creating a large number of promotion codes automatically through a background job. This table collects the input
|
25
|
+
for creating such a batch of promotion codes.
|
26
|
+
COMMENT
|
27
|
+
end
|
28
|
+
|
29
|
+
def id_comment
|
30
|
+
<<~COMMENT
|
31
|
+
Primary key of this table.
|
32
|
+
COMMENT
|
33
|
+
end
|
34
|
+
|
35
|
+
def promotion_id_comment
|
36
|
+
<<~COMMENT
|
37
|
+
Foreign key to the friendly_promotions table.
|
38
|
+
COMMENT
|
39
|
+
end
|
40
|
+
|
41
|
+
def base_code_comment
|
42
|
+
<<~COMMENT
|
43
|
+
The base code of this promotion code batch, such as "BOATLIFE".
|
44
|
+
COMMENT
|
45
|
+
end
|
46
|
+
|
47
|
+
def number_of_codes_comment
|
48
|
+
<<~COMMENT
|
49
|
+
How many codes should be generated.
|
50
|
+
COMMENT
|
51
|
+
end
|
52
|
+
|
53
|
+
def email_comment
|
54
|
+
<<~COMMENT
|
55
|
+
After the batch has been created, or in the event of an error, notify this email address.
|
56
|
+
COMMENT
|
57
|
+
end
|
58
|
+
|
59
|
+
def error_comment
|
60
|
+
<<~COMMENT
|
61
|
+
Error that has occurred during batch processing, if any.
|
62
|
+
COMMENT
|
63
|
+
end
|
64
|
+
|
65
|
+
def state_comment
|
66
|
+
<<~COMMENT
|
67
|
+
What the state of the promotion code batch is:
|
68
|
+
- pending
|
69
|
+
- processing
|
70
|
+
- completed
|
71
|
+
COMMENT
|
72
|
+
end
|
73
|
+
|
74
|
+
def created_at_comment
|
75
|
+
<<~COMMENT
|
76
|
+
Timestamp indicating when this record was created.
|
77
|
+
COMMENT
|
78
|
+
end
|
79
|
+
|
80
|
+
def updated_at_comment
|
81
|
+
<<~COMMENT
|
82
|
+
Timestamp indicating when this record was last updated.
|
83
|
+
COMMENT
|
84
|
+
end
|
85
|
+
|
86
|
+
def join_characters_comment
|
87
|
+
<<~COMMENT
|
88
|
+
What characters to use for joining the base code with the individual extension, such as "_" for creating "BOATLIFE_S3CR3T".
|
89
|
+
COMMENT
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyPromotionRulesStores < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_promotion_rules_stores, friendly_promotion_rules_stores_table_comment)
|
7
|
+
change_column_comment(:friendly_promotion_rules_stores, :id, id_comment)
|
8
|
+
change_column_comment(:friendly_promotion_rules_stores, :store_id, store_id_comment)
|
9
|
+
change_column_comment(:friendly_promotion_rules_stores, :promotion_rule_id, promotion_rule_id_comment)
|
10
|
+
change_column_comment(:friendly_promotion_rules_stores, :created_at, created_at_comment)
|
11
|
+
change_column_comment(:friendly_promotion_rules_stores, :updated_at, updated_at_comment)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def friendly_promotion_rules_stores_table_comment
|
18
|
+
<<~COMMENT
|
19
|
+
Join table between promotion rules and stores. Only used with the promotion rule "Store", which checks that an order
|
20
|
+
has been placed in a particular Spree::Store instance.
|
21
|
+
COMMENT
|
22
|
+
end
|
23
|
+
|
24
|
+
def id_comment
|
25
|
+
<<~COMMENT
|
26
|
+
Primary key of this table.
|
27
|
+
COMMENT
|
28
|
+
end
|
29
|
+
|
30
|
+
def store_id_comment
|
31
|
+
<<~COMMENT
|
32
|
+
Foreign key to the spree_stores table.
|
33
|
+
COMMENT
|
34
|
+
end
|
35
|
+
|
36
|
+
def promotion_rule_id_comment
|
37
|
+
<<~COMMENT
|
38
|
+
Foreign key to the friendly_promotion_rules table.
|
39
|
+
COMMENT
|
40
|
+
end
|
41
|
+
|
42
|
+
def created_at_comment
|
43
|
+
<<~COMMENT
|
44
|
+
Timestamp indicating when this record was created.
|
45
|
+
COMMENT
|
46
|
+
end
|
47
|
+
|
48
|
+
def updated_at_comment
|
49
|
+
<<~COMMENT
|
50
|
+
Timestamp indicating when this record was last updated.
|
51
|
+
COMMENT
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyPromotionActions < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_promotion_actions, friendly_promotion_actions_table_comment)
|
7
|
+
change_column_comment(:friendly_promotion_actions, :id, id_comment)
|
8
|
+
change_column_comment(:friendly_promotion_actions, :promotion_id, promotion_id_comment)
|
9
|
+
change_column_comment(:friendly_promotion_actions, :type, type_comment)
|
10
|
+
change_column_comment(:friendly_promotion_actions, :deleted_at, deleted_at_comment)
|
11
|
+
change_column_comment(:friendly_promotion_actions, :preferences, preferences_comment)
|
12
|
+
change_column_comment(:friendly_promotion_actions, :created_at, created_at_comment)
|
13
|
+
change_column_comment(:friendly_promotion_actions, :updated_at, updated_at_comment)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def friendly_promotion_actions_table_comment
|
20
|
+
<<~COMMENT
|
21
|
+
Single Table inheritance table. Represents what to do to an order when the linked promotion is eligible.
|
22
|
+
Promotions can have many promotion actions.
|
23
|
+
COMMENT
|
24
|
+
end
|
25
|
+
|
26
|
+
def id_comment
|
27
|
+
<<~COMMENT
|
28
|
+
Primary key of this table.
|
29
|
+
COMMENT
|
30
|
+
end
|
31
|
+
|
32
|
+
def promotion_id_comment
|
33
|
+
<<~COMMENT
|
34
|
+
Foreign key to the friendly_promotions table.
|
35
|
+
COMMENT
|
36
|
+
end
|
37
|
+
|
38
|
+
def type_comment
|
39
|
+
<<~COMMENT
|
40
|
+
A class name representing which promotion action this represents.
|
41
|
+
Usually SolidusFriendlyPromotions::Actions::Adjust{LineItem,Shipment}.
|
42
|
+
COMMENT
|
43
|
+
end
|
44
|
+
|
45
|
+
def deleted_at_comment
|
46
|
+
<<~COMMENT
|
47
|
+
Timestamp indicating if and when this record was soft-deleted.
|
48
|
+
COMMENT
|
49
|
+
end
|
50
|
+
|
51
|
+
def preferences_comment
|
52
|
+
<<~COMMENT
|
53
|
+
Preferences for this promotion action. Serialized YAML.
|
54
|
+
COMMENT
|
55
|
+
end
|
56
|
+
|
57
|
+
def created_at_comment
|
58
|
+
<<~COMMENT
|
59
|
+
Timestamp indicating when this record was created.
|
60
|
+
COMMENT
|
61
|
+
end
|
62
|
+
|
63
|
+
def updated_at_comment
|
64
|
+
<<~COMMENT
|
65
|
+
Timestamp indicating when this record was last updated.
|
66
|
+
COMMENT
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDbCommentsToFriendlyProductsPromotionRules < ActiveRecord::Migration[6.1]
|
4
|
+
def up
|
5
|
+
if connection.supports_comments?
|
6
|
+
change_table_comment(:friendly_products_promotion_rules, friendly_products_promotion_rules_table_comment)
|
7
|
+
change_column_comment(:friendly_products_promotion_rules, :id, id_comment)
|
8
|
+
change_column_comment(:friendly_products_promotion_rules, :product_id, product_id_comment)
|
9
|
+
change_column_comment(:friendly_products_promotion_rules, :promotion_rule_id, promotion_rule_id_comment)
|
10
|
+
change_column_comment(:friendly_products_promotion_rules, :created_at, created_at_comment)
|
11
|
+
change_column_comment(:friendly_products_promotion_rules, :updated_at, updated_at_comment)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def friendly_products_promotion_rules_table_comment
|
18
|
+
<<~COMMENT
|
19
|
+
Join table between promotion rules and products.
|
20
|
+
COMMENT
|
21
|
+
end
|
22
|
+
|
23
|
+
def id_comment
|
24
|
+
<<~COMMENT
|
25
|
+
Primary key of this table.
|
26
|
+
COMMENT
|
27
|
+
end
|
28
|
+
|
29
|
+
def product_id_comment
|
30
|
+
<<~COMMENT
|
31
|
+
Foreign key to the spree_products table.
|
32
|
+
COMMENT
|
33
|
+
end
|
34
|
+
|
35
|
+
def promotion_rule_id_comment
|
36
|
+
<<~COMMENT
|
37
|
+
Foreign key to the friendly_promotion_rules table.
|
38
|
+
COMMENT
|
39
|
+
end
|
40
|
+
|
41
|
+
def created_at_comment
|
42
|
+
<<~COMMENT
|
43
|
+
Timestamp indicating when this record was created.
|
44
|
+
COMMENT
|
45
|
+
end
|
46
|
+
|
47
|
+
def updated_at_comment
|
48
|
+
<<~COMMENT
|
49
|
+
Timestamp indicating when this record was last updated.
|
50
|
+
COMMENT
|
51
|
+
end
|
52
|
+
end
|