Created
August 2, 2014 05:56
-
-
Save amitittyerah/2f1f4b328fef6a888440 to your computer and use it in GitHub Desktop.
throws_error.rb Concern
This file contains hidden or 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
require 'active_support/concern' | |
module ThrowsError | |
extend ActiveSupport::Concern | |
included do | |
define_method 'errors_as_json' do |*args| | |
{ | |
errors: errors | |
} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment