lib/timeframe.rb in timeframe-0.0.7 vs lib/timeframe.rb in timeframe-0.0.8
- old
+ new
@@ -247,9 +247,15 @@
# Just a string that can be processed by Timeframe.interval... identical to #to_param
def to_json(*)
to_param
end
+ # http://jonathanjulian.com/2010/04/rails-to_json-or-as_json/
+ # Not really interested in making a Hash representation.
+ def as_json(*)
+ to_param
+ end
+
# URL-friendly like "2008-10-25/2009-11-12"
def to_param
"#{from}/#{to}"
end