Don't fail if Rivets.config.formatters isn't set
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -26,7 +26,10 @@ class Rivets.Binding | ... | @@ -26,7 +26,10 @@ class Rivets.Binding |
26 | for formatter in @formatters | 26 | for formatter in @formatters |
27 | args = formatter.split /\s+/ | 27 | args = formatter.split /\s+/ |
28 | id = args.shift() | 28 | id = args.shift() |
29 | value = (Rivets.config.formatters[id] || @model[id]) value, args... | 29 | value = if Rivets.config.formatters && Rivets.config.formatters[id] |
30 | Rivets.config.formatters[id] value, args... | ||
31 | else | ||
32 | @model[id] value, args... | ||
30 | 33 | ||
31 | value | 34 | value |
32 | 35 | ... | ... |
-
Please register or sign in to post a comment