2010-06-01 00:06:46 +00:00
|
|
|
module Locomotive
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-06-01 00:06:46 +00:00
|
|
|
module Mongoid
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-06-01 00:06:46 +00:00
|
|
|
module Document
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-06-01 00:06:46 +00:00
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
include ::Mongoid::Document
|
|
|
|
include ::Mongoid::Timestamps
|
|
|
|
include ::Mongoid::CustomFields
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2011-11-10 01:43:19 +00:00
|
|
|
# def to_json
|
|
|
|
#
|
|
|
|
# end
|
|
|
|
|
|
|
|
def as_json(options={})
|
|
|
|
attrs = super(options)
|
|
|
|
attrs["id"] = attrs["_id"]
|
|
|
|
attrs
|
|
|
|
end
|
|
|
|
|
2010-06-01 00:06:46 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-06-01 00:06:46 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
|
|
|
end
|