redline 0.3.2 → 0.3.3

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -5,7 +5,7 @@ module RedLine
5
5
  wanted_attributes = Braintree::Customer._create_signature.reject{|a| a.is_a? Hash}.reject{|a| a == :id}
6
6
  wanted_attributes.inject({}) {|hash, key| hash.merge(key => (self.send(self.class.braintree_customer_attribute_map[key] || key) rescue nil))}.
7
7
  merge(:custom_fields => self.class.braintree_customer_custom_fields.inject({}) {|hash, key| hash.merge(key => (self.send(self.class.braintree_customer_attribute_map[key] || key) rescue nil))}).
8
- reject { |key, value| value.empty?}
8
+ reject { |key, value| value == {}}
9
9
  end
10
10
  def customer
11
11
  Braintree::Customer.find(customer_id) if customer_id
data/redline.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{redline}
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Daniels"]
@@ -74,6 +74,16 @@ describe ComplexUser do
74
74
  :unused_attribute => 'unused'
75
75
  ).braintree_customer_attributes.should eql({:first_name=>"James", :last_name=>"Daniels", :email=>"james@marginleft.com", :custom_fields=>{:unused_attribute=>"unused"}})
76
76
  end
77
+
78
+ it "should work with nil attributes" do
79
+ Braintree::Customer.stub!('_create_signature').and_return([:first_name, :last_name, :email])
80
+ ComplexUser.new(
81
+ :firstname => 'James',
82
+ :lastname => 'Daniels',
83
+ :email => nil,
84
+ :unused_attribute => 'unused'
85
+ ).braintree_customer_attributes.should eql({:first_name=>"James", :last_name=>"Daniels", :email=> nil, :custom_fields=>{:unused_attribute=>"unused"}})
86
+ end
77
87
 
78
88
  end
79
89
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 2
9
- version: 0.3.2
8
+ - 3
9
+ version: 0.3.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - James Daniels