Permalink
Browse files

Added support for SugarCRM::Base#blank?

  • Loading branch information...
1 parent ac32fd1 commit 783dfb66ceea2b8e441a6b3745a96a1ca1373684 @chicks chicks committed Sep 27, 2011
Showing with 8 additions and 0 deletions.
  1. +4 −0 lib/sugarcrm/base.rb
  2. +4 −0 test/test_sugarcrm.rb
View
@@ -190,6 +190,10 @@ def reload!
self.attributes = self.class.find(self.id).attributes
end
+ def blank?
+ @attributes.empty?
+ end
+
# Returns true if +comparison_object+ is the same exact object, or +comparison_object+
# is of the same type and +self+ has an ID and it is equal to +comparison_object.id+.
#
View
@@ -187,6 +187,10 @@ class TestSugarCRM < ActiveSupport::TestCase
user = SugarCRM::User.first
assert_equal "#{SugarCRM.session.config[:base_url]}/index.php?module=Users&action=DetailView&record=#{user.id}", user.url
end
+
+ should "respond to #blank?" do
+ assert !SugarCRM::User.first.blank?
+ end
end
context "A SugarCRM::Note instance" do

0 comments on commit 783dfb6

Please sign in to comment.