Search code examples
ruby-on-railsrubyruby-on-rails-2

Make has_many :through not deleteable


I am using an active flag on my joined model, rather then deleting them. How can I specify a condition that prevents the possibility to destroy these entries?


Solution

  • Better you create a new field in your table and name it as is_deleted with data type boolean.And update it instead of destroying the data.