Created
August 22, 2011 15:13
-
-
Save ileitch/1162618 to your computer and use it in GitHub Desktop.
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
class SomeModel < ActiveRecord::Base | |
def some_method | |
raise NotImplementedError | |
end | |
end | |
module Api::V1::SomeModelMethods | |
def some_method | |
return {:blah => 1} | |
end | |
end | |
class Api::V1::SomeController < Api::V1::ApplicationController | |
class SomeModel | |
include Api::V1::SomeModelMethods | |
end | |
def index | |
render :json => SomeModel.all.map(&:some_method).to_json | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment