You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 17, 2020. It is now read-only.
class Entry < ActiveRecord::Base;end
def up
Entry.where(feed_id: nil).destroy_all
Entry.where(start_date: nil).destroy_all
Entry.where(end_date: nil).destroy_al
end
Uhm, to be honest, I don't see any difference between manually injected model and sql created by hand - on both cases it would explode if you pass invalid column (field) names.
me :
I see 3 solutions:
1.: GenericeModel
class DontAllowNullInEntries < ActiveRecord::Migration
class GenericModel < ActiveRecord::Base
self.table_name = 'entries
end
def up
GenericModel.where(...
...
end
def down; end
end
I'm migrating discussion here.
To wrap up what we have so far:
@Machiaweliczny:
@teamon :
@hodak :
@teamon :
@jandudulski:
me :
IMHO:
Personally I
believe reset_column_informationis the best solution as it is proposed byRails Guides™