NoMethodError: undefined method `with_deleted`

NoMethodError: undefined method `with_deleted`

I am trying to seed my database, but I am running into this error where its telling me with_deleted is an undefined method in my seeds.rb:

I am trying to seed my database, but I am running into this error where its telling me with_deleted is an undefined method in my seeds.rb:

User.with_deleted.each(&:really_destroy!)
User.create(
  email: '[email protected]',
  roles: [:admin],
  password: 'abc123',
  password_confirmation: 'abc123',
)

I believe it should have been defined from the paranoia gem. Can anyone suggest a workaround? I am working in Rails 5.1.

I tried both of these:

@user = User.create(
      email: '[email protected]',
      roles: [:admin],
      password: 'abc123',
      password_confirmation: 'abc123',
    )

and

User.create(
   email: '[email protected]',
   roles: [:admin],
   password: 'abc123',
   password_confirmation: 'abc123',
)

and it looked like it worked but when I did a User.last in rails c I still got nil

As far as including act_as_paranoid in my User.rb file, this is what I have:

# acts_as_paranoid
include AddressFields
include MeAssessmentScoring

Is this not enough? But ultimately, can I just get this working without having to involve the paranoiagem? So far, what I have tried above has not worked and when I try to create a user within rails c, I get:

ActiveRecord::RecordInvalid: Validation failed: First name can't be blank, Last name can't be blank

when I ran this: user = User.create!(email:'[email protected]', roles:'admin',password:'abc123', password_confirmation:'abc123')

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Ruby on Rails vs PHP

Understanding the pros and cons of Ruby on Rails versus PHP is important when deciding how to create your business-critical applications.