solidus_virtual_gift_card 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +35 -0
  3. data/Gemfile +20 -6
  4. data/README.md +4 -3
  5. data/Rakefile +2 -2
  6. data/app/controllers/spree/admin/gift_cards_controller.rb +14 -14
  7. data/app/controllers/spree/api/gift_cards_controller.rb +2 -2
  8. data/app/decorators/models/solidus_virtual_gift_card/spree/inventory_unit_decorator.rb +13 -0
  9. data/app/decorators/models/solidus_virtual_gift_card/spree/line_item_decorator.rb +24 -0
  10. data/app/{models/concerns/spree/gift_cards/order_contents_concerns.rb → decorators/models/solidus_virtual_gift_card/spree/order_contents_decorator.rb} +14 -20
  11. data/app/{models/concerns/spree/gift_cards/order_concerns.rb → decorators/models/solidus_virtual_gift_card/spree/order_decorator.rb} +14 -14
  12. data/app/{models → decorators/models/solidus_virtual_gift_card}/spree/store_credit_category_decorator.rb +1 -1
  13. data/app/mailers/spree/gift_card_mailer.rb +5 -2
  14. data/app/models/spree/gift_cards/gift_card_date_format_error.rb +6 -0
  15. data/app/models/{concerns/spree → spree}/redemption_code_generator.rb +0 -0
  16. data/app/models/spree/virtual_gift_card.rb +19 -16
  17. data/app/overrides/admin_gift_card_order_confirmation.rb +4 -4
  18. data/app/overrides/admin_item_view_gift_card_codes.rb +12 -12
  19. data/app/overrides/admin_user_sidebar_store_credits.rb +3 -3
  20. data/app/overrides/admin_user_sub_menu.rb +2 -2
  21. data/app/views/spree/admin/gift_cards/_lookup_form.html.erb +2 -2
  22. data/app/views/spree/admin/gift_cards/_redemption_form.html.erb +1 -1
  23. data/app/views/spree/admin/gift_cards/edit.html.erb +5 -5
  24. data/app/views/spree/admin/gift_cards/index.html.erb +1 -1
  25. data/app/views/spree/admin/gift_cards/lookup.html.erb +1 -1
  26. data/app/views/spree/admin/orders/_confirmation_gift_card_details.html.erb +9 -9
  27. data/app/views/spree/admin/orders/_gift_card_details.html.erb +2 -2
  28. data/app/views/spree/admin/users/_gift_card_sidebar.html.erb +2 -2
  29. data/app/views/spree/gift_card_mailer/gift_card_email.text.erb +3 -3
  30. data/config/initializers/line_item_controller_gift_card_details.rb +1 -1
  31. data/db/migrate/20140623152903_create_virtual_gift_card.rb +1 -1
  32. data/db/migrate/20140624175113_seed_gift_card_category.rb +1 -1
  33. data/db/migrate/20140627185148_add_timestamps_to_gift_cards.rb +1 -1
  34. data/db/migrate/20140702153907_add_gift_card_flag_to_products.rb +1 -1
  35. data/db/migrate/20140707200431_add_line_item_to_gift_card.rb +1 -1
  36. data/db/migrate/20151013172931_add_recipient_fields_to_virtual_gift_card.rb +1 -1
  37. data/db/migrate/20151013210615_add_active_flag_to_virtual_gift_card.rb +1 -1
  38. data/db/migrate/20151013214647_set_redeemable_true_on_virtual_gift_cards.rb +2 -2
  39. data/db/migrate/20151019190731_add_email_send_time_to_virtual_gift_card.rb +1 -1
  40. data/db/migrate/20151109202300_add_deactivated_at_to_gift_card.rb +1 -1
  41. data/db/migrate/20151110202752_add_inventory_unit_to_gift_card.rb +1 -1
  42. data/db/migrate/20151111211220_backfill_inventory_units_on_gift_card.rb +2 -2
  43. data/lib/generators/solidus_virtual_gift_card/install/install_generator.rb +1 -1
  44. data/lib/solidus_virtual_gift_card.rb +1 -0
  45. data/lib/spree_virtual_gift_card/engine.rb +3 -3
  46. data/lib/spree_virtual_gift_card/factories.rb +7 -7
  47. data/lib/tasks/send_gift_card_emails.rake +1 -1
  48. data/solidus_virtual_gift_card.gemspec +23 -21
  49. data/spec/controllers/spree/admin/gift_cards_controller_spec.rb +33 -34
  50. data/spec/controllers/spree/api/gift_cards_controller_spec.rb +12 -13
  51. data/spec/features/admin/gift_cards_spec.rb +19 -17
  52. data/spec/features/admin/products_card_spec.rb +3 -3
  53. data/spec/lib/tasks/send_gift_card_emails_spec.rb +12 -12
  54. data/spec/mailers/spree/gift_card_mailer_spec.rb +4 -4
  55. data/spec/models/concerns/spree/redemption_code_generator_spec.rb +5 -5
  56. data/spec/models/spree/line_item_spec.rb +2 -2
  57. data/spec/models/spree/order_contents_spec.rb +82 -82
  58. data/spec/models/spree/order_spec.rb +13 -13
  59. data/spec/models/spree/permission_sets/virtual_gift_card_display_spec.rb +2 -2
  60. data/spec/models/spree/permission_sets/virtual_gift_card_management_spec.rb +2 -2
  61. data/spec/models/spree/store_credit_category_spec.rb +6 -6
  62. data/spec/models/spree/virtual_gift_card_spec.rb +23 -23
  63. data/spec/spec_helper.rb +13 -74
  64. data/spec/support/cancan.rb +3 -0
  65. metadata +56 -25
  66. data/.travis.yml +0 -8
  67. data/app/models/concerns/spree/gift_cards/inventory_unit_concerns.rb +0 -10
  68. data/app/models/concerns/spree/gift_cards/line_item_concerns.rb +0 -22
  69. data/app/models/spree/inventory_unit_decorator.rb +0 -1
  70. data/app/models/spree/line_item_decorator.rb +0 -1
  71. data/app/models/spree/order_contents_decorator.rb +0 -1
  72. data/app/models/spree/order_decorator.rb +0 -1
  73. data/circle.yml +0 -6
@@ -1,8 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- env:
4
- matrix:
5
- - SOLIDUS_BRANCH=v1.2 DB=mysql
6
- - SOLIDUS_BRANCH=v1.2 DB=postgres
7
- rvm:
8
- - 2.1.8
@@ -1,10 +0,0 @@
1
- module Spree
2
- module GiftCards::InventoryUnitConcerns
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- has_one :gift_card, class_name: 'Spree::VirtualGiftCard'
7
- end
8
- end
9
- end
10
-
@@ -1,22 +0,0 @@
1
- module Spree
2
- module GiftCards::LineItemConcerns
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- has_many :gift_cards, class_name: Spree::VirtualGiftCard, dependent: :destroy
7
- delegate :gift_card?, :gift_card, to: :product
8
- self.whitelisted_ransackable_associations += %w[order]
9
- prepend(InstanceMethods)
10
- end
11
-
12
- module InstanceMethods
13
- def redemption_codes
14
- gift_cards.map {|gc| {amount: gc.formatted_amount, redemption_code: gc.formatted_redemption_code}}
15
- end
16
-
17
- def gift_card_details
18
- gift_cards.map(&:details)
19
- end
20
- end
21
- end
22
- end
@@ -1 +0,0 @@
1
- Spree::InventoryUnit.include Spree::GiftCards::InventoryUnitConcerns
@@ -1 +0,0 @@
1
- Spree::LineItem.include Spree::GiftCards::LineItemConcerns
@@ -1 +0,0 @@
1
- Spree::OrderContents.include Spree::GiftCards::OrderContentsConcerns
@@ -1 +0,0 @@
1
- Spree::Order.include Spree::GiftCards::OrderConcerns
data/circle.yml DELETED
@@ -1,6 +0,0 @@
1
- machine:
2
- ruby:
3
- version: 2.1.5
4
- test:
5
- pre:
6
- - bundle exec rake test_app