lib/saasable/mongoid/scoped_document.rb in saasable-5.0.1 vs lib/saasable/mongoid/scoped_document.rb in saasable-5.0.2

- old
+ new

@@ -1,13 +1,13 @@ module Saasable::Mongoid::ScopedDocument def self.included klass klass.extend ClassMethods klass.class_eval do # Fields - field :saas_id, type: BSON::ObjectId, default: ->{ Saasable::Mongoid::SaasDocument.active_saas } + field :saas_id, type: BSON::ObjectId, default: ->{ Saasable::Mongoid::SaasDocument.active_saas._id } # Default scope - default_scope ->{ Saasable::Mongoid::SaasDocument.active_saas ? where(saas_id: Saasable::Mongoid::SaasDocument.active_saas) : all } + default_scope ->{ Saasable::Mongoid::SaasDocument.active_saas ? where(saas_id: Saasable::Mongoid::SaasDocument.active_saas._id) : all } # Indexes index({saas_id: 1}) index({saad_id: 1, _id: 1})