JGailor-except 0.1.1 → 0.1.2

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.
@@ -1,3 +1,7 @@
1
+ === 0.1.2 / 2008-12-28
2
+
3
+ * Added a more lenient regex for splitting up the field names for the :except clause
4
+
1
5
  === 0.1.1 / 2008-12-28
2
6
 
3
7
  * Replaced the find_all with a simple array subtraction. Duh.
@@ -7,7 +7,7 @@ module Except
7
7
  def find_with_except(*args)
8
8
  options = args.last.is_a?(::Hash) ? args.pop : {}
9
9
  if exceptions = options.delete(:except)
10
- options[:select] = (self.column_names - exceptions.split(/,\s?/)).join(", ")
10
+ options[:select] = (self.column_names - exceptions.split(/\s*,\s*/)).join(", ")
11
11
  end
12
12
  args << options
13
13
  find_without_except(*args)
@@ -14,6 +14,12 @@ describe User do
14
14
  end
15
15
 
16
16
  it "should only bring back all the fields except for the ones in the except clause" do
17
- User.first(:except => "password").attribute_names.should_not include(:password)
17
+ User.first(:except => "password").attribute_names.should_not include("password")
18
+ end
19
+
20
+ it "should ignore spacing before and after fields in the :except clause" do
21
+ u = User.first(:except => "password , email")
22
+ u.attribute_names.should_not include("email")
23
+ u.attribute_names.should_not include("password")
18
24
  end
19
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: JGailor-except
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Gailor