sorted 0.3.0 → 0.3.1

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.0
1
+ 0.3.1
data/lib/sorted.rb CHANGED
@@ -28,7 +28,7 @@ module Sorted
28
28
  end
29
29
 
30
30
  def parse_query(sort)
31
- if m = sort.match(/(\w+)_(asc|desc)/)
31
+ if m = sort.match(/([a-zA-Z0-9._]+)_(asc|desc)/)
32
32
  [m[1],m[2]]
33
33
  end
34
34
  end
data/sorted.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sorted}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rufus Post"]
data/spec/sorted_spec.rb CHANGED
@@ -124,4 +124,9 @@ describe Sorted::ActionView do
124
124
  sorter = ActionView::Base.new([], {}, @controller).sorted(:email)
125
125
  sorter.css_class.should == "sorted-asc"
126
126
  end
127
+
128
+ it "should allow underscores and and full stops in" do
129
+ sorter = Sorted::Sorter.new('users.email ASC, users.phone_number DESC, assessments.name ASC', {:sort => "users.email_desc!users.first_name_desc"})
130
+ sorter.to_sql.should == "users.email DESC, users.first_name DESC, users.phone_number DESC, assessments.name ASC"
131
+ end
127
132
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Rufus Post