mongodb - How would one 'build' embedded documents in mongoid? -
trying create embedded documents collection. however, finding approach bit inefficient , long-coming. there better way like:
@stat.dates.find_or_create_by(date: 20130904).users.find_or_create_by(status: 'signed_in').update_attributes(count: 1234) i aware there autobuild directive. applies embeds_one , has_one associations.
any other approaches?
Comments
Post a Comment