Skip to content

[BUG] UnknownAttributeError on new version #1150

@luizkowalski

Description

@luizkowalski

Bug Report

Describe the Bug:
After upgrading to v10 and stripe ~> 15, I can't process webhooks from subscriptions anymore, I get this error.

Error: ActiveModel::UnknownAttributeError: unknown attribute 'object' for Pay::Stripe::Subscription.

The full trace (the important parts)

/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activemodel/lib/active_model/attribute_assignment.rb:57:in 'ActiveModel::AttributeAssignment#attribute_writer_missing'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activemodel/lib/active_model/attribute_assignment.rb:74:in 'ActiveModel::AttributeAssignment#_assign_attribute'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activerecord/lib/active_record/attribute_assignment.rb:27:in 'block in ActiveRecord::AttributeAssignment#assign_nested_parameter_attributes'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activerecord/lib/active_record/attribute_assignment.rb:27:in 'Hash#each'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activerecord/lib/active_record/attribute_assignment.rb:27:in 'ActiveRecord::AttributeAssignment#assign_nested_parameter_attributes'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activerecord/lib/active_record/attribute_assignment.rb:21:in 'ActiveRecord::AttributeAssignment#_assign_attributes'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activemodel/lib/active_model/attribute_assignment.rb:34:in 'ActiveModel::AttributeAssignment#assign_attributes'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activemodel/lib/active_model/api.rb:81:in 'ActiveModel::API#initialize'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activerecord/lib/active_record/core.rb:477:in 'ActiveRecord::Core#initialize'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activerecord/lib/active_record/inheritance.rb:76:in 'Class#new'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activerecord/lib/active_record/inheritance.rb:76:in 'ActiveRecord::Inheritance::ClassMethods#new'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activerecord/lib/active_record/persistence.rb:54:in 'ActiveRecord::Persistence::ClassMethods#create!'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/pay-10.0.0/app/models/pay/stripe/subscription.rb:94:in 'Pay::Stripe::Subscription.sync'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/pay-10.0.0/lib/pay/stripe/webhooks/checkout_session_completed.rb:17:in 'Pay::Stripe::Webhooks::CheckoutSessionCompleted#call'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/pay-10.0.0/lib/pay/webhooks/delegator.rb:50:in 'Pay::Webhooks::Delegator::NotificationAdapter#call'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:133:in 'block in ActiveSupport::Notifications::Fanout::BaseTimeGroup#finish'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:24:in 'block in ActiveSupport::Notifications::FanoutIteration#iterate_guarding_exceptions'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:23:in 'Array#each'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:23:in 'ActiveSupport::Notifications::FanoutIteration#iterate_guarding_exceptions'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:121:in 'ActiveSupport::Notifications::Fanout::BaseGroup#each'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:132:in 'ActiveSupport::Notifications::Fanout::BaseTimeGroup#finish'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:258:in 'block in ActiveSupport::Notifications::Fanout::Handle#finish_with_values'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:24:in 'block in ActiveSupport::Notifications::FanoutIteration#iterate_guarding_exceptions'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:23:in 'Array#each'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:23:in 'ActiveSupport::Notifications::FanoutIteration#iterate_guarding_exceptions'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:257:in 'ActiveSupport::Notifications::Fanout::Handle#finish_with_values'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/fanout.rb:250:in 'ActiveSupport::Notifications::Fanout::Handle#finish'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications/instrumenter.rb:64:in 'ActiveSupport::Notifications::Instrumenter#instrument'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/bundler/gems/rails-8b00d0985f88/activesupport/lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/pay-10.0.0/lib/pay/webhooks/delegator.rb:35:in 'Pay::Webhooks::Delegator#instrument'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/pay-10.0.0/lib/pay/webhooks.rb:7:in 'Pay::Webhooks.instrument'
/Users/luiz/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/pay-10.0.0/app/models/pay/webhook.rb:8:in 'Pay::Webhook#process!'

What's triggering this is a flow that have: couple of prices that subscribe the user to a monthly plan

Expected Behavior:

Actual Behavior:

Screenshots (if applicable):

Environment:

  • Pay gem version: 10.0.0
  • Stripe: 15.0.0
  • Ruby version: 3.4.3
  • Rails version: main
  • Operating System: macOS

Additional Context:

  • I have searched for similar issues and couldn't find any
  • I have checked the documentation for relevant information
  • I have included all the required information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions