Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings, issue #294 #300

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/solidus_subscriptions/installment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,9 @@ def next_actionable_date

(DateTime.current + SolidusSubscriptions.configuration.reprocessing_interval).beginning_of_minute
end

def self.ransackable_attributes(_auth_object = nil)
%w[actionable_date created_at id id_value subscription_id updated_at]
end
end
end
10 changes: 9 additions & 1 deletion app/models/solidus_subscriptions/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def self.processing_states
end

after_transition to: :active, do: :advance_actionable_date
after_transition do: :emit_event_for_transition
#after_transition do: :emit_event_for_transition
end

# This method determines if a subscription may be canceled. Canceled
Expand Down Expand Up @@ -432,5 +432,13 @@ def emit_events_for_update
emit_event(type: 'subscription_payment_method_changed')
end
end

def self.ransackable_attributes(_auth_object = nil)
%w[actionable_date billing_address_id created_at currency end_date guest_token id id_value interval_length interval_units paused payment_method_id payment_source_id payment_source_type shipping_address_id skip_count state store_id successive_skip_count updated_at user_id]
end

def self.ransackable_associations(_auth_object = nil)
%w[billing_address events installment_details installments line_items orders payment_method payment_source shipping_address store user]
end
end
end
4 changes: 4 additions & 0 deletions app/models/solidus_subscriptions/subscription_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ class SubscriptionEvent < ApplicationRecord
after_initialize do
self.details ||= {}
end

def self.ransackable_attributes(_auth_object = nil)
%w[created_at details event_type id id_value subscription_id updated_at]
end
end
end
4 changes: 2 additions & 2 deletions lib/solidus_subscriptions/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class Engine < Rails::Engine

::Spree::Backend::Config.configure do |config|
config.menu_items << config.class::MenuItem.new(
[:subscriptions],
'repeat',
label: :subscriptions,
icon: 'repeat',
url: :admin_subscriptions_path,
condition: ->{ can?(:admin, SolidusSubscriptions::Subscription) },
match_path: '/subscriptions'
Expand Down