Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mongomapper/mongomapper
...
head fork: umamao/mongomapper
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 6 commits
  • 4 files changed
  • 0 commit comments
  • 2 contributors
Commits on Jun 20, 2010
@onemanstartup onemanstartup add active model plugin to work with Devise 3f33a6c
@onemanstartup onemanstartup fix typo 5b539bd
@onemanstartup onemanstartup fix typo 06e8bba
@onemanstartup onemanstartup fix typo 22e8dea
@onemanstartup onemanstartup fix typo 520850b
Commits on Jan 30, 2011
@obvio171 obvio171 Merge remote branch 'BadMinus/master'
* BadMinus/master:
  fix typo
  fix typo
  fix typo
  fix typo
  add active model plugin to work with Devise
66637ea
View
1  lib/mongo_mapper.rb
@@ -23,6 +23,7 @@ module Middleware
end
module Plugins
+ autoload :ActiveModelSupport, 'mongo_mapper/plugins/active_model_support'
autoload :Associations, 'mongo_mapper/plugins/associations'
autoload :Accessible, 'mongo_mapper/plugins/accessible'
autoload :Callbacks, 'mongo_mapper/plugins/callbacks'
View
2  lib/mongo_mapper/document.rb
@@ -6,7 +6,7 @@ module Document
def self.included(model)
model.class_eval do
extend Plugins
-
+ plugin Plugins::ActiveModelSupport
plugin Plugins::Document
plugin Plugins::Querying # for now needs to be before associations (save_to_collection)
plugin Plugins::Associations
View
2  lib/mongo_mapper/embedded_document.rb
@@ -6,7 +6,7 @@ module EmbeddedDocument
def self.included(model)
model.class_eval do
extend Plugins
-
+ plugin Plugins::ActiveModelSupport
plugin Plugins::EmbeddedDocument
plugin Plugins::Associations
plugin Plugins::Caching
View
16 lib/mongo_mapper/plugins/active_model_support.rb
@@ -0,0 +1,16 @@
+module MongoMapper
+ module Plugins
+ module ActiveModelSupport
+ def self.configure(model)
+ model.class_eval do
+ include ActiveModel::Serializers::Xml
+ include ActiveModel::Conversion
+ include ActiveModel::Naming
+ include ActiveModel::Serialization
+ include ActiveModel::Serializers::JSON
+ model.extend ActiveModel::Translation if defined?(ActiveModel)
+ end
+ end
+ end
+ end
+end

No commit comments for this range

Something went wrong with that request. Please try again.