Open maksar opened 12 years ago
If you can make it work and pass the specs I'll gladly accept a pull request. I cut them out somewhere in alpha1 or alpha2 because of the way the arel matching works did not work with default_scopes. The .to_sql conversion doesn't always work everywhere either, at least in the 3.0 series.
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.