Skip to content

Commit

Permalink
history.md and cleaned up the getters
Browse files Browse the repository at this point in the history
  • Loading branch information
Radagaisus committed Nov 3, 2012
1 parent 56dd5fb commit 0a932f7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ user('putin')
```

### Getting the Model ID
Only when new models are created `exec()` receives the model ID as the last argument.
Only when new models are created `.exec()` receives the model ID as the last argument.

```coffee
user()
Expand Down
6 changes: 4 additions & 2 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

# 0.1.11

- zscore, zrank and zrevrank added for getting stuff
- `zscore`, `zrank`, `count`, `zrevrank`, `zrevrangebyscore` were added to the `getters` array.

- removed returning the user_id for existing models.
- `user_id` is not being passed to `.exec()` for existing models any more. Only new models will receive `user_id` inside `.exec()` as the last argument.

- Everything is now being tested with redis 2.6.

# 0.1.10

Expand Down
7 changes: 2 additions & 5 deletions lib/commands.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ module.exports =
# - brpoplpush and friends

getters: [
# String, Number
'hget',


# List
# - blpop and friends
'lrange',

# Set
Expand All @@ -59,7 +56,7 @@ module.exports =
'zrevrank',
'zcount',

# Hash
# Hash, String, Number
'hget',
'hgetall',
'hmget'
Expand Down
15 changes: 5 additions & 10 deletions lib/orpheus.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -446,16 +446,11 @@ class OrpheusAPI
for key, value of @model
type = value.type
switch type
when 'str', 'num'
@[key].get()
when 'list'
@[key].range 0, -1
when 'set'
@[key].members()
when 'zset'
@[key].range 0, -1, 'withscores'
when 'hash'
@[key].hgetall()
when 'str', 'num' then @[key].get()
when 'list' then @[key].range 0, -1
when 'set' then @[key].members()
when 'zset' then @[key].range 0, -1, 'withscores'
when 'hash' then @[key].hgetall()

@exec fn

Expand Down
3 changes: 2 additions & 1 deletion test/orpheus.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,8 @@ describe 'Maps', ->
done()



# Relations
# -------------------------
describe 'Relations', ->

it 'One has', (done) ->
Expand Down

0 comments on commit 0a932f7

Please sign in to comment.