Skip to content

ArgumentError When Saving ActiveRecord-based Models #110

Closed
@nbibler

Description

@nbibler

The recent change to define an API on Model added a save definition. This, however, seems to conflict with the existing ActiveRecord implementation provided by Rails (where save accepts options) and the shim in this library, which do not allow for arguments.

This incompatibility results in errors when attempting to create records in Rails:

ArgumentError:
  wrong number of arguments (given 1, expected 0)
# /ruby/2.7.1/lib/ruby/gems/2.7.0/gems/omniauth-identity-3.0.6/lib/omniauth/identity/model.rb:85:in `save'

The new save definition introduced here a few days ago:

def save
raise NotImplementedError unless defined?(super)
super
end

The existing ActiveRecord interface which does not override save and just inherits it:

module OmniAuth
module Identity
module Models
class ActiveRecord < ::ActiveRecord::Base
include OmniAuth::Identity::Model

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