Following code could be used to ensure, that default scope works as expected:
EmailLetter.scoped.to_sql.should == EmailLetter.unscoped.where(:sent => false, :error => false).to_sql
Usage would be:
it { should have_default_scope.where(:sent => false, :error => false) }
I'll provide pull request if needed.
Following code could be used to ensure, that default scope works as expected:
EmailLetter.scoped.to_sql.should == EmailLetter.unscoped.where(:sent => false, :error => false).to_sql
Usage would be:
it { should have_default_scope.where(:sent => false, :error => false) }
I'll provide pull request if needed.