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.
- checksums.yaml +5 -5
- data/.circleci/config.yml +35 -0
- data/Gemfile +20 -6
- data/README.md +4 -3
- data/Rakefile +2 -2
- data/app/controllers/spree/admin/gift_cards_controller.rb +14 -14
- data/app/controllers/spree/api/gift_cards_controller.rb +2 -2
- data/app/decorators/models/solidus_virtual_gift_card/spree/inventory_unit_decorator.rb +13 -0
- data/app/decorators/models/solidus_virtual_gift_card/spree/line_item_decorator.rb +24 -0
- data/app/{models/concerns/spree/gift_cards/order_contents_concerns.rb → decorators/models/solidus_virtual_gift_card/spree/order_contents_decorator.rb} +14 -20
- data/app/{models/concerns/spree/gift_cards/order_concerns.rb → decorators/models/solidus_virtual_gift_card/spree/order_decorator.rb} +14 -14
- data/app/{models → decorators/models/solidus_virtual_gift_card}/spree/store_credit_category_decorator.rb +1 -1
- data/app/mailers/spree/gift_card_mailer.rb +5 -2
- data/app/models/spree/gift_cards/gift_card_date_format_error.rb +6 -0
- data/app/models/{concerns/spree → spree}/redemption_code_generator.rb +0 -0
- data/app/models/spree/virtual_gift_card.rb +19 -16
- data/app/overrides/admin_gift_card_order_confirmation.rb +4 -4
- data/app/overrides/admin_item_view_gift_card_codes.rb +12 -12
- data/app/overrides/admin_user_sidebar_store_credits.rb +3 -3
- data/app/overrides/admin_user_sub_menu.rb +2 -2
- data/app/views/spree/admin/gift_cards/_lookup_form.html.erb +2 -2
- data/app/views/spree/admin/gift_cards/_redemption_form.html.erb +1 -1
- data/app/views/spree/admin/gift_cards/edit.html.erb +5 -5
- data/app/views/spree/admin/gift_cards/index.html.erb +1 -1
- data/app/views/spree/admin/gift_cards/lookup.html.erb +1 -1
- data/app/views/spree/admin/orders/_confirmation_gift_card_details.html.erb +9 -9
- data/app/views/spree/admin/orders/_gift_card_details.html.erb +2 -2
- data/app/views/spree/admin/users/_gift_card_sidebar.html.erb +2 -2
- data/app/views/spree/gift_card_mailer/gift_card_email.text.erb +3 -3
- data/config/initializers/line_item_controller_gift_card_details.rb +1 -1
- data/db/migrate/20140623152903_create_virtual_gift_card.rb +1 -1
- data/db/migrate/20140624175113_seed_gift_card_category.rb +1 -1
- data/db/migrate/20140627185148_add_timestamps_to_gift_cards.rb +1 -1
- data/db/migrate/20140702153907_add_gift_card_flag_to_products.rb +1 -1
- data/db/migrate/20140707200431_add_line_item_to_gift_card.rb +1 -1
- data/db/migrate/20151013172931_add_recipient_fields_to_virtual_gift_card.rb +1 -1
- data/db/migrate/20151013210615_add_active_flag_to_virtual_gift_card.rb +1 -1
- data/db/migrate/20151013214647_set_redeemable_true_on_virtual_gift_cards.rb +2 -2
- data/db/migrate/20151019190731_add_email_send_time_to_virtual_gift_card.rb +1 -1
- data/db/migrate/20151109202300_add_deactivated_at_to_gift_card.rb +1 -1
- data/db/migrate/20151110202752_add_inventory_unit_to_gift_card.rb +1 -1
- data/db/migrate/20151111211220_backfill_inventory_units_on_gift_card.rb +2 -2
- data/lib/generators/solidus_virtual_gift_card/install/install_generator.rb +1 -1
- data/lib/solidus_virtual_gift_card.rb +1 -0
- data/lib/spree_virtual_gift_card/engine.rb +3 -3
- data/lib/spree_virtual_gift_card/factories.rb +7 -7
- data/lib/tasks/send_gift_card_emails.rake +1 -1
- data/solidus_virtual_gift_card.gemspec +23 -21
- data/spec/controllers/spree/admin/gift_cards_controller_spec.rb +33 -34
- data/spec/controllers/spree/api/gift_cards_controller_spec.rb +12 -13
- data/spec/features/admin/gift_cards_spec.rb +19 -17
- data/spec/features/admin/products_card_spec.rb +3 -3
- data/spec/lib/tasks/send_gift_card_emails_spec.rb +12 -12
- data/spec/mailers/spree/gift_card_mailer_spec.rb +4 -4
- data/spec/models/concerns/spree/redemption_code_generator_spec.rb +5 -5
- data/spec/models/spree/line_item_spec.rb +2 -2
- data/spec/models/spree/order_contents_spec.rb +82 -82
- data/spec/models/spree/order_spec.rb +13 -13
- data/spec/models/spree/permission_sets/virtual_gift_card_display_spec.rb +2 -2
- data/spec/models/spree/permission_sets/virtual_gift_card_management_spec.rb +2 -2
- data/spec/models/spree/store_credit_category_spec.rb +6 -6
- data/spec/models/spree/virtual_gift_card_spec.rb +23 -23
- data/spec/spec_helper.rb +13 -74
- data/spec/support/cancan.rb +3 -0
- metadata +56 -25
- data/.travis.yml +0 -8
- data/app/models/concerns/spree/gift_cards/inventory_unit_concerns.rb +0 -10
- data/app/models/concerns/spree/gift_cards/line_item_concerns.rb +0 -22
- data/app/models/spree/inventory_unit_decorator.rb +0 -1
- data/app/models/spree/line_item_decorator.rb +0 -1
- data/app/models/spree/order_contents_decorator.rb +0 -1
- data/app/models/spree/order_decorator.rb +0 -1
- data/circle.yml +0 -6
data/.travis.yml
DELETED
@@ -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
|