Cthulhu 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4b7288760b69b6b550d647ea7f0c2b769a2c716
4
- data.tar.gz: 43acd21b68e3c87204e3074b568faf7896358c61
3
+ metadata.gz: ad4ee3f934818f5b5f53595ad13043f026e8f6b8
4
+ data.tar.gz: e18578a7faf11e2ae1ad48ce0271f79bae6f4638
5
5
  SHA512:
6
- metadata.gz: a4bde1eb17bc1df9a4aa656147475ee4400fac963f0afad59ca6b2a0cb670db8382bc807d74e01b9ecde54ef0ce1869fe95b354a32d0e2c0e4852bcf676ee947
7
- data.tar.gz: b2613453c30e869b5cbec7f006fec13c7c1a422301ad0eda98cac6a22c4484ac2048f81bbdf5d4ac1eacec98cddbf68e72168c0fbf1308e9fb78d4e86e3d8dc1
6
+ metadata.gz: e4f4dad17d864a8730a184951d7987d749799bbcc1bdf06bb070b27d533ac64fb99fa3a35b3762035d1c51ca5ed7b5fb7f9fadf821ac720105b365d77ed45314
7
+ data.tar.gz: ab948e9b897926df54f611fbce2940b2aa4b9a8f9aa639a097e4ef3ce8ef37dcb95bf9605dcfa6d8af1cb00d13f4a8f130a71369331de55006eed85ce584eee9
@@ -22,11 +22,11 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "bundler", "~> 1.11"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  spec.add_development_dependency "minitest", "~> 5.0"
25
- spec.add_development_dependency "pg", '~> 0'
26
- spec.add_development_dependency "schema_dev", '~> 0'
27
- spec.add_development_dependency "pry", '~> 0'
28
- spec.add_development_dependency "factory_girl", '~> 0'
29
- spec.add_development_dependency "database_cleaner", '~> 0'
25
+ spec.add_development_dependency "pg", '~> 0.18'
26
+ spec.add_development_dependency "schema_dev", '~> 3.7'
27
+ spec.add_development_dependency "pry", '~> 0.10'
28
+ spec.add_development_dependency "factory_girl", '~> 4.7'
29
+ spec.add_development_dependency "database_cleaner", '~> 1.5'
30
30
 
31
31
  spec.add_dependency "activerecord", "~> 4.2"
32
32
  end
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
+ [![Build Status](https://travis-ci.org/bookingexperts/cthulhu.svg?branch=master)](https://travis-ci.org/bookingexperts/cthulhu)
2
+
1
3
  # Cthulhu
2
4
 
3
- ![Cthulhu, the destroyer of words](Cthulhu.jpg?raw=true "Cthulhu")
5
+ ![Cthulhu, the destroyer of worlds](Cthulhu.jpg?raw=true "Cthulhu")
4
6
 
5
7
  By using this gem, you will be able to destroy objects and all of their associated children without fetching them from database or using cascade.
6
8
 
@@ -9,9 +11,11 @@ This is useful for big applications that:
9
11
  * have foreign keys but you do not want to setup cascades to protect users from removing stuff that they do not mean.
10
12
  * Database is too big and you do not want to use ActiveRecord's `dependant: :destroy` for performance reasons.
11
13
 
12
- So as foreign keys are setup, you can not accidentally destroy a record and all of its children by doing something like this in console:
14
+ So as foreign keys are setup, you can not accidentally destroy a record:
13
15
 
14
16
  ```ruby
17
+ # will raise ActiveRecord::InvalidForeignKey if other tables are referencing to
18
+ # this row.
15
19
  User.destroy 1
16
20
  ```
17
21
 
@@ -23,7 +27,7 @@ Cthulhu.destroy! User.find(1)
23
27
 
24
28
  ## Transaction
25
29
 
26
- Keep in mind that Cthulhu is destroyer, therefore, it is not wrapped in any transaction. To be safe, you need to call it within a transaction like so:
30
+ Keep in mind that Cthulhu is a destroyer, therefore, it is not wrapped in any transaction. To be safe, you need to call it within a transaction like this:
27
31
 
28
32
  ```ruby
29
33
  user = User.find 1
@@ -67,7 +71,7 @@ posts | \
67
71
  images
68
72
 
69
73
  ```
70
- (see test/models.rb)
74
+ (see [test/models.rb](test/models.rb))
71
75
 
72
76
  You can expect the following queries to be executed if you do `Cthulhu.destroy! User.find(5)`
73
77
 
@@ -137,7 +141,7 @@ DELETE FROM "users"
137
141
  WHERE "users"."id" = 5;
138
142
  ```
139
143
 
140
- In above scenario, it is possibly to nullify the comments and images of user instead of removing them completely without changing anything in actual association:
144
+ In above scenario, it is possible to nullify the comments and images of user instead of removing them completely without changing anything in actual association:
141
145
 
142
146
  ```ruby
143
147
  Cthulhu.destroy! User.find(5),
File without changes
@@ -1,3 +1,3 @@
1
1
  module Cthulhu
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Cthulhu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - |
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-18 00:00:00.000000000 Z
12
+ date: 2016-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -59,70 +59,70 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '0'
62
+ version: '0.18'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '0'
69
+ version: '0.18'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: schema_dev
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0'
76
+ version: '3.7'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0'
83
+ version: '3.7'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: pry
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0'
90
+ version: '0.10'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: '0.10'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: factory_girl
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: '4.7'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '0'
111
+ version: '4.7'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: database_cleaner
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: '0'
118
+ version: '1.5'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: '0'
125
+ version: '1.5'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: activerecord
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -153,7 +153,7 @@ files:
153
153
  - LICENSE.txt
154
154
  - README.md
155
155
  - Rakefile
156
- - lib/cthulhu.rb
156
+ - lib/Cthulhu.rb
157
157
  - lib/cthulhu/destroyer.rb
158
158
  - lib/cthulhu/scopper.rb
159
159
  - lib/cthulhu/uncrawlable_hierarchy.rb