hangar 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05b21d3044fac13d79bc4de5248da33d85303fbe
4
- data.tar.gz: 0244f98b90b4b08193bf9b5c3a7066f011c1c75a
3
+ metadata.gz: f0c1cfd8cac035868a3d51ccc792dbae52422e37
4
+ data.tar.gz: 84094e8e534d52f51371c9a54d301fbc1007d50f
5
5
  SHA512:
6
- metadata.gz: 2aa958c3da4851519a4f04752ae5231fe5d3837c7c9e315bc648ffacee3e135836ebdbde79b28735eaeec4194079f930b79d783c8cdba50af5d57f15998af304
7
- data.tar.gz: e8ad099e3b80daaf499a48312621d930e74053fe52a5953f4db876c37b47484787a963b331b4f2ac79970d7cf083829ee00ac79d56feb1490c3e5d1576a342bf
6
+ metadata.gz: 8f68acc7c08c485a0e1bdb40aa1eb5272b8449173da11f10dca695645803cb01ba49e8abf66cf7b44f21507ceb7208649a0343ab71907569f9f941e59b1f3ade
7
+ data.tar.gz: 05034b676eac73589444205167e471d65c9a44d833117adfcd2bd26ea7b1b1d840a7a684e126ff19e8afd2d208dc5c5ff78f879c78fd07294be43f096b3705d0
@@ -3,8 +3,8 @@ module Hangar
3
3
  respond_to :json
4
4
 
5
5
  def delete
6
- DatabaseCleaner.clean_with :deletion
6
+ DatabaseCleaner.clean_with :deletion, except: Hangar.do_not_delete
7
7
  render nothing: true, status: :no_content
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Hangar
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/hangar.rb CHANGED
@@ -5,6 +5,12 @@ require 'database_cleaner'
5
5
  module Hangar
6
6
  BadEnvironmentError = Class.new(StandardError)
7
7
 
8
+ mattr_writer :do_not_delete
9
+
10
+ def self.do_not_delete
11
+ Array.wrap(@@do_not_delete)
12
+ end
13
+
8
14
  def validate_environment
9
15
  Rails.env.test? or raise BadEnvironmentError, "Hangar should not be used in the #{Rails.env} environment"
10
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hangar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Rossmeissl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-23 00:00:00.000000000 Z
11
+ date: 2014-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails