mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Make Rails' respond_with play nice with to_json.
This commit is contained in:
parent
7eb360636a
commit
1d9f0af243
2 changed files with 4 additions and 4 deletions
|
@ -115,9 +115,9 @@ module Fog
|
||||||
Formatador.display_table(self.map {|instance| instance.attributes}, attributes)
|
Formatador.display_table(self.map {|instance| instance.attributes}, attributes)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_json
|
def to_json(options = {})
|
||||||
require 'json'
|
require 'json'
|
||||||
self.map {|member| member.attributes}.to_json
|
self.map {|member| member.attributes}.to_json(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -37,9 +37,9 @@ module Fog
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_json
|
def to_json(options = {})
|
||||||
require 'json'
|
require 'json'
|
||||||
attributes.to_json
|
attributes.to_json(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def wait_for(timeout=Fog.timeout, interval=1, &block)
|
def wait_for(timeout=Fog.timeout, interval=1, &block)
|
||||||
|
|
Loading…
Add table
Reference in a new issue