Skip to content

Commit

Permalink
4.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed May 3, 2014
1 parent a40b103 commit 3fc4f52
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 4.21.2

- Add option `format` to `Category#id`. E.g. `id :number, :format => :to_i`. Tells Picky to convert the `number` attribute to an Integer. Same functionality as `Category#key_format`.

## 4.21.1

- Add method `id` to category. E.g. `id :number`. Tells Picky to use method `number` instead of the default `id`.

## 4.21.0

- Rename "aux" folder to "tools".
Expand Down
2 changes: 1 addition & 1 deletion server/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
picky (4.21.0)
picky (4.21.1)
activesupport
multi_json (~> 1.3)
rack_fast_escape (~> 2009.0)
Expand Down
3 changes: 2 additions & 1 deletion server/lib/picky/index_indexing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def unblock_source
# === Parameters
# * name: Method name of the ID.
#
def id name = nil
def id name = nil, options = {}
key_format options[:format]
@id_name = name || @id_name || :id
end

Expand Down
3 changes: 1 addition & 2 deletions server/spec/functional/id_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
data = Picky::Index.new :id do
source { things }

key_format :to_i
id :number # TODO :format => :to_i
id :number, format: 'to_i'
category :text
end

Expand Down
2 changes: 1 addition & 1 deletion version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Picky
VERSION = '4.21.1'
VERSION = '4.21.2'
end

0 comments on commit 3fc4f52

Please sign in to comment.