rails model.blank? returns false even though I purged the db -


i have model of journey. refresh db, called following

rake db:reset db:migrate 

which should purge database of existing data , restart database.

i called journey.first in console, returns nil expected.

but why when called journey.blank? returns false? database not empty (or blank) @ point?

if not, how can check see if journey model empty or not?

you want check see if there no elements in database, not if object is blank.

for that, make count query instead.

journey.count # should return 0 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -