Questions tagged [acts-as-paranoid]

A simple plugin for Ruby on Rails that hides records instead of deleting them, enabling recovery.

acts-as-paranoid is a Rails simple plugin which hides records instead of deleting them, being able to recover them.

48 questions
0
votes
1 answer

Acts as paranoid gem interferes with acts as list

I use both acts_as_paranoid and acts_as_list for the same model, CheckIn. I have the gem setup as follows: class CheckIn < ActiveRecord::Base acts_as_paranoid belongs_to :client acts_as_list scope: :client, column: :week, top_of_list:…
Jeremy Thomas
  • 6,240
  • 9
  • 47
  • 92
0
votes
1 answer

paranoia issue with ransack on applying filter

I am using gem 'paranoia', '> 2.3.1' gem 'ransack', '> 1.8', '>= 1.8.7' and on applying the filter it is not working perfectly can anybody tell me what is the issue or do I need to add extra configurations to make paranoia runnable with…
Ali Hassan Mirza
  • 552
  • 11
  • 23
0
votes
3 answers

Acts as paranoid is not recovering associations

I am attempting to use the acts_as_paranoid gem with no luck. I have a Client model: class Client < ActiveRecord::Base acts_as_paranoid has_many :purchases, dependent: :destroy has_many :payments, dependent: :destroy end and when I…
Jeremy Thomas
  • 6,240
  • 9
  • 47
  • 92
0
votes
2 answers

How to unscope multiple models in rails?

I am trying to unscope multiple model as below User Model which has acts_as_paranoid class User acts_as_paranoid has_one :category has_one :brand has_one :item INDEXED_FIELDS = { only: [:name], include: { category:…
Pramod Shinde
  • 1,802
  • 1
  • 15
  • 28
0
votes
1 answer

has_many association for only soft deleted records

I want to do a has_many association for a model that has some records with deleted_at not nil and i want to be able to only retrieve those records via a has_many association but currently it is not working and i am not sure how to fix it. class…
Kingsley Simon
  • 2,090
  • 5
  • 38
  • 84
0
votes
1 answer

acts_as_list with paranoia gem

I have two models. The first ModelA is the parent of ModelB. ie ModelA has_many ModelB. [When modelA is destroyed, all its dependent ModelB's also gets destroyed due to dependent destroy Now I have acts_as_paranoid scope: :ModelA With this,I also…
0
votes
1 answer

Restore recursive does not restore entries in join table

Setup class Profile < ApplicationRecord acts_as_paranoid has_many :degreeholderships has_many :degrees, through: :degreeholderships, dependent: :destroy end class Degreeholdership < ApplicationRecord acts_as_paranoid column: :active,…
0
votes
1 answer

How to make a helper method to check existance status of an object?

I'm using Rails4, And also using ActsAsParanoid to handle deleted dependencies in my views. order.rb class Order < ActiveRecord::Base ... has_many :ice_creams accepts_nested_attributes_for :ice_creams validates :user, :shift, :discount,…
Moataz Zaitoun
  • 729
  • 1
  • 7
  • 18
0
votes
1 answer

ActiveAdmin with Paranoia

I want to soft delete(archive) records through the index view but the default action actually destroys the record completely rather than adding a timestamp deleted_at column. Ive tried to override the link_to method to be sure that activeadmin isnt…
Dan Mitchell
  • 844
  • 2
  • 15
  • 34
0
votes
0 answers

Paranoia's 'with_deleted' command not working on Rails tasks

I have the following task to run on Rais: require 'net/http' namespace :seed do task :set_gid_on_histories => :environment do History.all.each do |hist| if hist.channel != "REMOTE" if hist.guest guest =…
Casanova
  • 33
  • 6
0
votes
1 answer

Rails acts_as_paranoid migration giving error on confirmation of devise

class Advertiser < ActiveRecord::Base devise :database_authenticatable, :registerable,:recoverable, :rememberable, :trackable, :validatable,:confirmable acts_as_paranoid end I added the Devise gem first without the confirmable option. Then I…
user5496955
0
votes
1 answer

ArgumentError: wrong number of arguments (0 for 1) rails 4

In terminal: 2.2.0 :001 > sr=ServiceRequest.only_deleted.where(:id=>57) => #
Uday kumar das
  • 1,615
  • 16
  • 33
0
votes
2 answers

undefined method `paranoid?' for nil:NilClass

I am using gem 'paranoia', '~> 1.0' in my rails 3.2.x app. paranoia version installed is 1.3.3 I am getting that error when I do recursive: true I have tried user.restore! recursive: true and User.find(user.id, recursive: true) I am getting same…
RodM
  • 426
  • 1
  • 5
  • 19
0
votes
1 answer

RSpec: paranoid2 - can't modify frozen Hash

I'm working on RSpec tests for my model which uses paranoid2 gem. This is some kind of paranoia or acts_as_paranoid - overwrites .delete and .destroy and some other with it's own versions which marks data as deleted rather than deleting it until you…
pawel7318
  • 3,383
  • 2
  • 28
  • 44
0
votes
1 answer

Rails4 paranoid2 trash implementation

The problem is solved and wasn't on the Rails router which I blamed. I hope leave this helpfull to someone who wants to implement Trash functionality with paranoid2 gem. I'm using paranoid2 gem (like acts-as-paranoid but for Rails4) to protect my…
pawel7318
  • 3,383
  • 2
  • 28
  • 44