Skip to content

Instantly share code, notes, and snippets.

@ivanacostarubio
Forked from sxross/gist:4711848
Created February 5, 2013 03:24
Show Gist options
  • Save ivanacostarubio/4711920 to your computer and use it in GitHub Desktop.
Save ivanacostarubio/4711920 to your computer and use it in GitHub Desktop.
module MotionModel
module Model
def save(*)
puts "called MM#save"
end
end
end
module MotionModel
module Paranoid
def save(paranoid = false)
puts paranoid ? super : "error because it is not valid"
end
end
end
class MyModel
include MotionModel::Model
include MotionModel::Paranoid
end
model = MyModel.new
model.save
model.save(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment