Skip to content

Instantly share code, notes, and snippets.

@sevos
Created October 6, 2011 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sevos/1267179 to your computer and use it in GitHub Desktop.
Save sevos/1267179 to your computer and use it in GitHub Desktop.
Semi-DCI Example
class Department << ActiveRecord::Base
end
class DepartmentsController
def update_stock_value
stock = Department.find(params[:id]).extend Roles::Stock
stock.update
end
end
module Roles
module Stock
def update
# fetch value from external application and store
end
def value
stock_value
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment