bitswitch 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -139,6 +139,9 @@ if defined? ActiveRecord::Base
139
139
  KellyLSB::BitSwitch::LocalInstanceMethods.send(:define_method, column.to_sym) do |*args|
140
140
  val = read_attribute(column)
141
141
 
142
+ # If nil make 0
143
+ val = 0 if val.nil?
144
+
142
145
  # Make sure the value is an integer
143
146
  raise KellyLSB::BitSwitch::Error, "Column: #{column} is not an integer!" unless val.is_a?(Fixnum)
144
147
 
@@ -156,6 +159,9 @@ if defined? ActiveRecord::Base
156
159
  KellyLSB::BitSwitch::LocalInstanceMethods.send(:define_method, columne.to_sym) do |input|
157
160
  val = read_attribute(column)
158
161
 
162
+ # If nil make 0
163
+ val = 0 if val.nil?
164
+
159
165
  # Make sure the value is an integer
160
166
  raise KellyLSB::BitSwitch::Error, "Column: #{column} is not an integer!" unless val.is_a?(Fixnum)
161
167
 
@@ -1,3 +1,3 @@
1
1
  module Bitswitch
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitswitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: