Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (26 sloc) 0.543 kb
# encoding: UTF-8
module MongoMapper
module Plugins
module Safe
extend ActiveSupport::Concern
module ClassMethods
def inherited(subclass)
super
subclass.safe if safe?
end
def safe
@safe = true
end
def safe?
@safe == true
end
end
module InstanceMethods
def save_to_collection(options={})
options[:safe] = self.class.safe? unless options.key?(:safe)
super
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.