sbfaulkner-sequel_cascading 1.0.3 → 1.0.4

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/README.markdown CHANGED
@@ -43,6 +43,10 @@ Install the gem(s):
43
43
 
44
44
  ## UPDATES
45
45
 
46
+ ### 1.0.4
47
+
48
+ - [foca] define callback methods instead of using deprecated api
49
+
46
50
  ### 1.0.3
47
51
 
48
52
  - added support for :nullify and :restrict options
@@ -3,13 +3,13 @@ module Sequel
3
3
  module Cascading
4
4
  def self.apply(model, options = {})
5
5
  Array(options[:destroy]).each do |assoc|
6
- model.instance_eval "before_destroy { #{assoc}_dataset.destroy }"
6
+ model.instance_eval "def before_destroy; super; #{assoc}_dataset.destroy; end"
7
7
  end
8
8
  Array(options[:nullify]).each do |assoc|
9
- model.instance_eval "before_destroy { remove_all_#{assoc} }"
9
+ model.instance_eval "def before_destroy; super; remove_all_#{assoc}; end"
10
10
  end
11
11
  Array(options[:restrict]).each do |assoc|
12
- model.instance_eval "before_destroy { raise Error::InvalidOperation, 'Delete would orphan associated #{assoc}' unless #{assoc}_dataset.empty? }"
12
+ model.instance_eval "def before_destroy; super; raise Error::InvalidOperation, 'Delete would orphan associated #{assoc}' unless #{assoc}_dataset.empty?; end"
13
13
  end
14
14
  end
15
15
  end
@@ -1,7 +1,7 @@
1
1
  SPEC = Gem::Specification.new do |s|
2
2
  # identify the gem
3
3
  s.name = "sequel_cascading"
4
- s.version = "1.0.3"
4
+ s.version = "1.0.4"
5
5
  s.author = "S. Brent Faulkner"
6
6
  s.email = "brentf@unwwwired.net"
7
7
  s.homepage = "http://github.com/sbfaulkner/sequel_cascading"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbfaulkner-sequel_cascading
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - S. Brent Faulkner
@@ -9,11 +9,12 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-11 00:00:00 -08:00
12
+ date: 2009-04-08 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sequel
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements: