prevent_destroy 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -16,10 +16,12 @@ module PreventDestroy
16
16
  record.children_to_check.each { |search| found << search.to_s.underscore.humanize.downcase if record.send(search).any? }
17
17
  end
18
18
  if found.any?
19
- record.errors.add_to_base("The #{self.class.name.underscore.humanize.downcase} cannot be deleted as it contains #{found.to_sentence}")
19
+ record.errors.add(:base, "The #{self.class.name.underscore.humanize.downcase} cannot be deleted as it contains #{found.to_sentence}")
20
20
  false
21
21
  end
22
22
  end
23
23
  end
24
24
  end
25
- end
25
+ end
26
+
27
+ ActiveRecord::Base.send :include, PreventDestroy
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{prevent_destroy}
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marc Tauber"]
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
26
26
  "README.rdoc",
27
27
  "Rakefile",
28
28
  "VERSION",
29
- "init.rb",
30
29
  "lib/prevent_destroy.rb",
31
30
  "prevent_destroy.gemspec",
32
31
  "spec/prevent_destroy_spec.rb",
@@ -4,7 +4,6 @@ require 'rspec'
4
4
  require 'active_record'
5
5
  require 'active_support/core_ext/logger' rescue nil # rails3
6
6
  require 'prevent_destroy'
7
- require File.join(File.dirname(__FILE__), '../init')
8
7
 
9
8
  # Requires supporting files with custom matchers and macros, etc,
10
9
  # in ./support/ and its subdirectories.
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 0
9
- version: 0.0.0
8
+ - 1
9
+ version: 0.0.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Marc Tauber
@@ -126,7 +126,6 @@ files:
126
126
  - README.rdoc
127
127
  - Rakefile
128
128
  - VERSION
129
- - init.rb
130
129
  - lib/prevent_destroy.rb
131
130
  - prevent_destroy.gemspec
132
131
  - spec/prevent_destroy_spec.rb
@@ -145,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
144
  requirements:
146
145
  - - ">="
147
146
  - !ruby/object:Gem::Version
148
- hash: -1000703533
147
+ hash: 1065776979
149
148
  segments:
150
149
  - 0
151
150
  version: "0"
data/init.rb DELETED
@@ -1 +0,0 @@
1
- ActiveRecord::Base.send :include, PreventDestroy