hobo_files/plugin/lib/hobo/scopes/automatic_scopes.rb in hobo-0.7.4 vs hobo_files/plugin/lib/hobo/scopes/automatic_scopes.rb in hobo-0.7.5
- old
+ new
@@ -4,9 +4,12 @@
module AutomaticScopes
def create_automatic_scope(name)
ScopeBuilder.new(self, name).create_scope
+ rescue ActiveRecord::StatementInvalid
+ # Problem with the database? Don't try to create automatic scopes
+ false
end
end
# The methods on this module add scopes to the given class