-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
activemodel (support for other mappers like mongoid)? #7
Comments
I think you can use it right away. One way is to use auto_html method that is available in any object that includes AutoHtml module. You'd only have to implement before_save if you want to cache result. Other (not sure if it will work) is to include AutoHtmlFor module (if you want auto_html_for method) in non AR model which uses only before_save callback and read/write attribute methods so I guess it should work with mongoid. Please let me know of the result if you try that out. |
Currently Working
|
Thanks! I've included the fix, and added your example to readme. |
Great! In the readme you should change the title from "Non-ActiveModel models" to "Non-ActiveRecord models" |
Good catch, thanks. |
Seems like this would be a great addition to activemodel for Rails3 so it could be used across other database mappers (mongoid, mongo_mapper, datamapper).
I'd love to use it with mongoid right now. How easy would a port be?
The text was updated successfully, but these errors were encountered: