Module: Devise::Orm::MongoMapper::Compatibility
- Extended by:
- ActiveModel::Naming, ActiveSupport::Concern
- Includes:
- ActiveModel::Serializers::JSON, ActiveModel::Serializers::Xml
- Defined in:
- lib/devise/orm/mongo_mapper/compatibility.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#invalid? ⇒ Boolean
def save(options=nil) if options.is_a?(Hash) && options == false save! else super() end end.
- #to_xml(options = {}, &block) ⇒ Object
Instance Method Details
#invalid? ⇒ Boolean
def save(options=nil)
if options.is_a?(Hash) && options[:validate] == false
save!
else
super()
end
end
def update_attribute(name, value)
update_attributes(name => value)
end
#
# def update_attributes(*args)
# update(*args)
# end
83 84 85 |
# File 'lib/devise/orm/mongo_mapper/compatibility.rb', line 83 def invalid? !valid? end |
#to_xml(options = {}, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/devise/orm/mongo_mapper/compatibility.rb', line 13 def to_xml( = {}, &block) [:except] ||= [] [:except] << :_id super do |b| b.id self.id block.call(b) if block_given? end end |