Created
November 11, 2010 16:01
-
-
Save capoferro/672680 to your computer and use it in GitHub Desktop.
response.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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