Skip to content

Instantly share code, notes, and snippets.

@capoferro
Created November 11, 2010 16:01
Show Gist options
  • Save capoferro/672680 to your computer and use it in GitHub Desktop.
Save capoferro/672680 to your computer and use it in GitHub Desktop.
response.rb
class Response
attr_reader :errors
attr_accessor :data
def initialize data=[]
@data = []
@data << data
@data.flatten!
@errors = ActiveModel::Errors.new(self)
end
def self.human_attribute_name field, mappings
mappings[:default]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment