zero_downtime 0.2.1 → 0.2.2

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: 90b2fb495197327ab698102779a0b606ae202f36
4
- data.tar.gz: 32a7e5ee151c8f5f9c33349569a4f666f07e6a28
3
+ metadata.gz: dde9799f65bdb23430fba12c384b392873ecd1d9
4
+ data.tar.gz: def035b42a3e906094425200fcbf57b602c0cb84
5
5
  SHA512:
6
- metadata.gz: 878f523c0300154fa9c145a8c1de5181ea1524e51f4e2393be4f8a83a58645ece21eaae0a81a0327ce3e85566c9f4c892680feeeb145888c38f5234f694b274f
7
- data.tar.gz: 25b2e870303b499762282565e34504660936848f645f56e335baf755c2d2983607e22433d7ea7518bd5d044e1a7cf21667db74d9fdea3e92ac5531e5435661b9
6
+ metadata.gz: ede37af28786dd85336373e874c029c8a152dffc013bc1e465cbe6e885af7ebcee264395cbf357c9724b6f77ff50e62e98c105dfb38cfb2a9b514e4c03f295f3
7
+ data.tar.gz: b30e3ade26a386461f540965b30ae69da19c73d8fc8a8f2539329f3c7332ddbd925ea94d05846074e4f21ac95e902e4d4f17a6cfbe6a48105f12ec72c6fcf6d9
@@ -26,8 +26,8 @@ module ZeroDowntime
26
26
  # deprecate a given column
27
27
  # so it will be ignore by activerecord
28
28
  # we can remove it once the deprecation is deployed
29
- def deprecate_column(column_name)
30
- deprecate_column_reader(column_name)
29
+ def deprecate_column(column_name, options={})
30
+ deprecate_column_reader(column_name, options)
31
31
  deprecate_column_writer(column_name)
32
32
  override_attribute_methods
33
33
 
@@ -61,9 +61,15 @@ module ZeroDowntime
61
61
  @attribute_methods_overriden = true
62
62
  end
63
63
 
64
- def deprecate_column_reader(column_name)
65
- define_method(column_name) do
66
- fail DeprecatedColumn, "attempted to read #{column_name}"
64
+ def deprecate_column_reader(column_name, options)
65
+ if options[:nil]
66
+ define_method(column_name) do
67
+ nil
68
+ end
69
+ else
70
+ define_method(column_name) do
71
+ fail DeprecatedColumn, "attempted to read #{column_name}"
72
+ end
67
73
  end
68
74
  end
69
75
 
@@ -1,3 +1,3 @@
1
1
  module ZeroDowntime # :nodoc:
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zero_downtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Rudy Jacobs