Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5.0.beta1 opengov #1

Open
wants to merge 75 commits into
base: v0.4.2-opengov
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
0c692d2
Remove Gemfile.lock from repository
Feb 24, 2014
9e6ee17
Resolve warning about rake/rdoctask
Feb 24, 2014
0d5956f
Move test dependencies into gemspec as development dependencies
Feb 24, 2014
d6d4699
Support activerecord >= 4.0.0
Feb 24, 2014
631ffaf
bump gem to 0.5.0
Feb 24, 2014
587074b
Update gemspec summary and description to remove dependency mention.
Feb 24, 2014
9de04ab
Add gemfile support for testing against various versions of
Feb 24, 2014
c24aefd
Fix trailing spaces on files.
Mar 7, 2014
1f45d2d
Merge pull request #3 from andremedeiros/whitespace-fix
Mar 7, 2014
f4fc7ba
Modernized the gem, and a few other tweaks.
Mar 7, 2014
5a47cdf
Support AR from 3.0 onwards.
Mar 7, 2014
bd2d0d7
Merge pull request #1 from andremedeiros/modernize-gem
Mar 7, 2014
86ecbcd
Added gemfiles to test AR 3.1 and 3.2
Mar 7, 2014
d5a831f
Make Travis test only the versions that we actually support
Mar 7, 2014
95ecde7
Lock sqlite3 version so tests run with rbx
Mar 7, 2014
e2ad638
Silence more deprecations
Mar 7, 2014
c36e3ed
Documentation improvements
Mar 7, 2014
1bb293a
Move the AR dependency back to 3.1
Mar 7, 2014
7c543aa
Merge pull request #4 from andremedeiros/master
Mar 12, 2014
48ff312
Add Zachary to the authors and change the gem homepage.
Apr 5, 2014
67c6923
Merge pull request #5 from andremedeiros/master
May 12, 2014
5a23726
Test Ruby 2.1.x [ci skip]
May 12, 2014
879c66e
Delete duplicate description content
May 12, 2014
e7da594
Use original 0.4.x ActiveRecord dependency, we shouldn't change this
May 12, 2014
b8ebaef
Preparing 0.4.x patch level release first
May 12, 2014
2e9fd78
For this release we don't need AR 4+ gemfiles
May 12, 2014
e9cf44b
Use pessimistic dependency requirement
May 12, 2014
7fb0b5c
Use gemspec for remaining dependencies
May 12, 2014
fa21bfa
Fix typo in gemspec authors
May 12, 2014
0a66132
Add André Medeiros for his help!
May 12, 2014
5a1bafd
Enable 1.8.7 for Rails 3.x
May 12, 2014
ee96785
Allow testing of AR 3.0.0 since this patch level supports all Rails 3…
May 12, 2014
6714ab9
Revert "Allow testing of AR 3.0.0 since this patch level supports all…
May 12, 2014
f13cc2f
Correction, this patch level release will only support Rails 3.2.x
May 12, 2014
546267e
Markdown syntax
May 12, 2014
b1b61c1
Rails 3.2 still supported Ruby 1.8, so we should do our best.
May 12, 2014
7b9b0d7
Make sure we use latest sqlite3 1.3.x when testing
May 12, 2014
61b26a5
Move gemspec after platform dependencies
May 12, 2014
a944af8
Move Credits below Acknowledgements [ci skip]
May 12, 2014
2fcc4c6
Update Copyright notice [ci skip]
May 12, 2014
990a9c7
Add rdoc as development dependency to let Ruby 1.8 tests run
May 12, 2014
17cf61a
Add minitest as development dependency to let tests run on Ruby 1.8
May 12, 2014
37725d8
Remove ./gemfiles since we only test one version of Rails
May 12, 2014
5e6bc34
Mark as pre-release
May 12, 2014
fbcbdd4
Master is now 0.5.x
May 12, 2014
b583c3c
Update README.markdown
Aug 28, 2013
17617a4
Merge andremedeiros/acts_as_paranoid@f77770e manually
May 12, 2014
d2748d6
Remove init.rb
Aug 11, 2014
c1e4004
Specify branch support for master, add Gonçalo to credits.
Aug 11, 2014
f53f13b
See `LICENSE`.
Aug 11, 2014
7cb5ccd
Update homepage
Aug 11, 2014
ed2a82e
Fixed minor spelling mistake
binarycleric Aug 21, 2014
52c5166
Merge pull request #15 from binarycleric/spelling_fixup
Aug 22, 2014
75a4662
rm 1.8 support, test against ruby-head
Aug 25, 2014
2b5fa82
Target AR 4.x
Aug 25, 2014
6f7fa03
This branch targets 4.x
Aug 25, 2014
18d9ec4
Thank you @technoweenie!! <3 <3
Aug 25, 2014
f672e87
Update repository homepage to org
Aug 25, 2014
6bb32b2
build travis
Aug 25, 2014
7057280
Initial test matrix setup for AR 4+ on travis
Aug 25, 2014
82845ba
Fix typo in version iteration of Rakefile
Aug 25, 2014
5bf262e
belongs_to_with_deleted should pass scope to belongs_to_without_deleted
yuki24 Mar 19, 2013
e796b9f
don't save when destroying a non persisted object
pelargir May 11, 2013
ec9c311
Rails 4.0.0 compatibility
byroot Feb 26, 2013
d5c17ad
Merged in @byroot's Rails 4.0.0 support, thank you! <3 <3 <3
Aug 26, 2014
c6d7c28
Add travis script for test
Aug 26, 2014
115f762
bump to beta1
Aug 26, 2014
d7929c0
result is a hash
Aug 29, 2014
9fdd810
Don't eager load logger, we no longer support 1.8.7 anyways
Aug 29, 2014
6142210
Use unscoped instead of with_default_scope
Aug 29, 2014
eef6a4f
serialized_attributes has been deprecated in rails/rails#15704
Aug 29, 2014
ddcd191
Use timestamps with null: false
Aug 29, 2014
15dce0d
merged ActsAsParanoid/master into v0.4.2-opengov
pavlos Mar 9, 2015
d22837f
rebuilt Gemfile.lock
pavlos Mar 9, 2015
0d4c7ae
REVERT ME EVENTUALLY- type_for_attribute patch
pavlos Mar 22, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pkg
.bundle
.DS_Store
Gemfile.lock
gemfiles/*.lock
21 changes: 18 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
language: ruby
script: "bundle exec rake test"
rvm:
- 1.9.2
- 1.9.3
- jruby-19mode
- rbx-19mode
- 2.0.0
- 2.1
- ruby-head
- jruby
- rbx
gemfile:
- gemfiles/active_record_40.gemfile
- gemfiles/active_record_41.gemfile
- gemfiles/active_record_42.gemfile
- gemfiles/active_record_edge.gemfile
matrix:
allow_failures:
- rvm: ruby-head
- rvm: rbx
- rvm: jruby
- gemfile: gemfiles/active_record_edge.gemfile
fast_finish: true
20 changes: 5 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
source "http://rubygems.org"

gem "activerecord", "~>3.2"
source "https://rubygems.org"

# Development dependencies
gem "rake", "10.1.1"
gem "activesupport", "~>3.2"

platforms :ruby do
gem "sqlite3", "1.3.9"
end

platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter"
group :development do
gem "sqlite3", :platforms => [:ruby]
gem "activerecord-jdbcsqlite3-adapter", :platforms => [:jruby]
end

group :test do
gem "minitest"
gem "autotest-growl"
end
gemspec
72 changes: 39 additions & 33 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
PATH
remote: .
specs:
acts_as_paranoid (0.5.0.beta1)
activerecord (~> 4.0)
activesupport (~> 4.0)

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
activemodel (3.2.3)
activesupport (= 3.2.3)
builder (~> 3.0.0)
activerecord (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activerecord-jdbc-adapter (1.2.9.1)
activerecord-jdbcsqlite3-adapter (1.2.9)
activerecord-jdbc-adapter (~> 1.2.9)
jdbc-sqlite3 (~> 3.7.2)
activesupport (3.2.3)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
autotest-growl (0.2.16)
builder (3.0.0)
i18n (0.6.0)
jdbc-sqlite3 (3.7.2.1)
minitest (2.12.1)
multi_json (1.3.4)
rake (10.1.1)
sqlite3 (1.3.9)
tzinfo (0.3.33)
activemodel (4.0.13)
activesupport (= 4.0.13)
builder (~> 3.1.0)
activerecord (4.0.13)
activemodel (= 4.0.13)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.13)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.13)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.2)
builder (3.1.4)
i18n (0.7.0)
minitest (4.7.5)
multi_json (1.11.0)
rake (10.4.2)
rdoc (4.2.0)
sqlite3 (1.3.10)
thread_safe (0.3.4)
tzinfo (0.3.43)

PLATFORMS
java
ruby

DEPENDENCIES
activerecord (~> 3.2)
activerecord-jdbcsqlite3-adapter
activesupport (~> 3.2)
autotest-growl
minitest
rake (= 10.1.1)
sqlite3 (= 1.3.9)
acts_as_paranoid!
bundler (~> 1.5)
minitest (~> 4.0)
rake
rdoc
sqlite3
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010 Gonçalo Silva
Copyright (c) 2014 Zachary Scott, Gonçalo Silva, Rick Olson

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
50 changes: 17 additions & 33 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# ActsAsParanoid

A simple plugin which hides records instead of deleting them, being able to recover them.
[![Build Status](https://travis-ci.org/ActsAsParanoid/acts_as_paranoid.png?branch=master)](https://travis-ci.org/ActsAsParanoid/acts_as_paranoid)

**This branch targets Rails 3.2.** If you're working with another version, switch to the corresponding branch.
A Rails plugin to add soft delete.

## Credits
This gem can be used to hide records instead of deleting them, making them recoverable later.

This plugin was inspired by [acts_as_paranoid](http://github.com/technoweenie/acts_as_paranoid) and [acts_as_active](http://github.com/fernandoluizao/acts_as_active).
## Support

While porting it to Rails 3, I decided to apply the ideas behind those plugins to an unified solution while removing a **lot** of the complexity found in them. I eventually ended up writing a new plugin from scratch.
**This branch targets Rails 4.x.**

If you're working with another version, switch to the corresponding branch, or require an older version of the acts_as_paranoid gem.

## Usage

Expand Down Expand Up @@ -187,13 +189,15 @@ Associations are also supported. From the simplest behaviors you'd expect to mor

```ruby
class Parent < ActiveRecord::Base
has_many :children, :class_name => "ParanoiacChild"
has_many :children, :class_name => "ParanoiacChild"
end

class ParanoiacChild < ActiveRecord::Base
belongs_to :parent
belongs_to :parent_including_deleted, :class_name => "Parent", :with_deleted => true
# You cannot name association *_with_deleted
acts_as_paranoid
belongs_to :parent

# You may need to provide a foreign_key like this
belongs_to :parent_including_deleted, :class_name => "Parent", foreign_key => 'parent_id', :with_deleted => true
end

parent = Parent.first
Expand All @@ -215,37 +219,17 @@ Watch out for these caveats:
- `unscoped` will return all records, deleted or not
- Assignment of `self.table_name` in a model must come before `acts_as_paranoid` or you will get SQL errors.

# Support

This gem supports the most recent versions of Rails and Ruby.

## Rails

For Rails 3.2 check the README at the [rails3.2](https://github.com/goncalossilva/rails3_acts_as_paranoid/tree/rails3.2) branch and add this to your Gemfile:

gem "acts_as_paranoid", "~>0.4.0"

For Rails 3.1 check the README at the [rails3.1](https://github.com/goncalossilva/rails3_acts_as_paranoid/tree/rails3.1) branch and add this to your Gemfile:

gem "rails3_acts_as_paranoid", "~>0.1.4"

For Rails 3.0 check the README at the [rails3.0](https://github.com/goncalossilva/rails3_acts_as_paranoid/tree/rails3.0) branch and add this to your Gemfile:

gem "rails3_acts_as_paranoid", "~>0.0.9"


## Ruby

This gem is tested on Ruby 1.9, JRuby and Rubinius (both in 1.9 mode). It *might* work fine in 1.8, but it's not officially supported.

# Acknowledgements

* To [Rick Olson](https://github.com/technoweenie) for creating acts_as_paranoid
* To [cheerfulstoic](https://github.com/cheerfulstoic) for adding recursive recovery
* To [Jonathan Vaught](https://github.com/gravelpup) for adding paranoid validations
* To [Geoffrey Hichborn](https://github.com/phene) for improving the overral code quality and adding support for after_commit
* To [flah00](https://github.com/flah00) for adding support for STI-based associations (with :dependent)
* To [vikramdhillon](https://github.com/vikramdhillon) for the idea and initial implementation of support for string column type
* To [Craig Walker](https://github.com/softcraft-development) for Rails 3.1 support and fixing various pending issues
* To [Charles G.](https://github.com/chuckg) for Rails 3.2 support and for making a desperately needed global code refactoring
* To [Gonçalo Silva](https://github.com/goncalossilva) for supporting this gem prior to v0.4.3
* To [Jean Boussier](https://github.com/byroot) for initial Rails 4.0.0 support

Copyright © 2010 Gonçalo Silva, released under the MIT license
See `LICENSE`.
49 changes: 22 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
begin
require "bundler"
Bundler.setup
rescue LoadError
$stderr.puts "You need to have Bundler installed to be able build this gem."
end
require "bundler/gem_tasks"

require "rake/testtask"
require "rdoc/task"

gemspec = eval(File.read(Dir["*.gemspec"].first))


desc 'Default: run unit tests.'
task :default => :test
task :default => "test:all"

namespace :test do
%w(active_record_edge active_record_40 active_record_41 active_record_42).each do |version|
desc "Test acts_as_paranoid against #{version}"
task version do
sh "BUNDLE_GEMFILE='gemfiles/#{version}.gemfile' bundle --quiet"
sh "BUNDLE_GEMFILE='gemfiles/#{version}.gemfile' bundle exec rake -t test"
end
end

desc "Run all tests for acts_as_paranoid"
task :all do
%w(active_record_edge active_record_40 active_record_41 active_record_42).each do |version|
sh "BUNDLE_GEMFILE='gemfiles/#{version}.gemfile' bundle --quiet"
sh "BUNDLE_GEMFILE='gemfiles/#{version}.gemfile' bundle exec rake -t test"
end
end
end

desc 'Test the acts_as_paranoid plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'

test_files = FileList['test/**/test_*.rb']
test_files.exclude('test/test_helper.rb')
t.test_files = test_files

t.pattern = 'test/test_*.rb'
t.verbose = true
end

Expand All @@ -34,18 +41,6 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end

desc "Validate the gemspec"
task :gemspec do
gemspec.validate
end

desc "Build gem locally"
task :build => :gemspec do
system "gem build #{gemspec.name}.gemspec"
FileUtils.mkdir_p "pkg"
FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
end

desc "Install gem locally"
task :install => :build do
system "gem install pkg/#{gemspec.name}-#{gemspec.version}"
Expand Down
38 changes: 25 additions & 13 deletions acts_as_paranoid.gemspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
Gem::Specification.new do |s|
s.name = "acts_as_paranoid"
s.version = "0.4.2"
s.platform = Gem::Platform::RUBY
s.authors = ["Goncalo Silva", "Charles G.", "Rick Olson"]
s.email = ["goncalossilva@gmail.com"]
s.homepage = "https://github.com/goncalossilva/rails3_acts_as_paranoid"
s.summary = "Active Record (~>3.2) plugin which allows you to hide and restore records without actually deleting them."
s.description = "Active Record (~>3.2) plugin which allows you to hide and restore records without actually deleting them. Check its GitHub page for more in-depth information."
s.rubyforge_project = s.name
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'acts_as_paranoid/version'

s.required_rubygems_version = ">= 1.3.6"
Gem::Specification.new do |spec|
spec.name = "acts_as_paranoid"
spec.version = ActsAsParanoid::VERSION
spec.authors = ["Zachary Scott", "Goncalo Silva", "Rick Olson"]
spec.email = ["e@zzak.io"]
spec.summary = "Active Record plugin which allows you to hide and restore records without actually deleting them."
spec.description = "Check the home page for more in-depth information."
spec.homepage = "https://github.com/ActsAsParanoid/acts_as_paranoid"
spec.license = "MIT"

s.add_dependency "activerecord", "~> 3.2"
spec.files = Dir["{lib}/**/*.rb", "LICENSE", "*.md"]
spec.test_files = Dir["test/*.rb"]
spec.require_paths = ["lib"]

s.files = Dir["{lib}/**/*.rb", "LICENSE", "*.markdown"]
spec.required_rubygems_version = ">= 1.3.6"

spec.add_dependency "activerecord", "~> 4.0"
spec.add_dependency "activesupport", "~> 4.0"

spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake"
spec.add_development_dependency "rdoc"
spec.add_development_dependency "minitest", "~> 4.0"
end
25 changes: 25 additions & 0 deletions gemfiles/active_record_40.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
source 'https://rubygems.org'

gem 'activerecord', '~> 4.0.0', :require => 'active_record'
gem 'activesupport', '~> 4.0.0', :require => 'active_support'

platforms :ruby do
if RUBY_VERSION > "2.1.0"
gem 'sqlite3'
else
gem 'sqlite3', '1.3.8'
end
end

platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter', '>= 1.3.0'
end

platforms :rbx do
gem 'rubysl', '~> 2.0'
gem 'racc'
gem 'rubysl-test-unit'
gem 'rubinius-developer_tools'
end

gemspec :path => '../'
25 changes: 25 additions & 0 deletions gemfiles/active_record_41.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
source 'https://rubygems.org'

gem 'activerecord', '~> 4.1.0', :require => 'active_record'
gem 'activesupport', '~> 4.1.0', :require => 'active_support'

platforms :ruby do
if RUBY_VERSION > "2.1.0"
gem 'sqlite3'
else
gem 'sqlite3', '1.3.8'
end
end

platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter', '>= 1.3.0'
end

platforms :rbx do
gem 'rubysl', '~> 2.0'
gem 'racc'
gem 'minitest'
gem 'rubinius-developer_tools'
end

gemspec :path => '../'
Loading