-
heroku db:migrate error
HTML Code:
class MapCities < ActiveRecord::Migration
def up
TelephoneRecord.all.each do |tel|
phone_record = PhoneRecord.new({
:name => tel.name,
:phone_no => tel.phone_no,
:address => tel.address
})
phone_record.city = City.find_or_create_by_name(tel.selectcity)
phone_record.save
end
drop_table :telephone_records
end
end
when i try to deploy on this state heroku db:migrate it says uninitialized constant MapCities::TelephoneRecord then i changed it to following
HTML Code:
class MapCities < ActiveRecord::Migration
def up
create_table :telephone_records do |tel|
phone_record = PhoneRecord.new({
:name => tel.name,
:phone_no => tel.phone_no,
:address => tel.address
})
phone_record.city = City.find_or_create_by_name(tel.selectcity)
phone_record.save
end
drop_table :telephone_records
end
end
now the error is undefined method 'name' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Tabledefination:0x000000043c17f8>
-
http://blog.heroku.com/archives/2009...d_from_heroku/
Try pushing your database using this:
The reason it's saying TelephoneRecord doesn't exist is because that model is no longer in your code.
-
it worked everything went fine finally i was able to push to heroku destructive action was given as warning now the problem is i am not able to search records in heroku????
http://furious-earth-6304.herokuapp.com/phone_records
localhost:3000/phone_records its perfect
-
-
done it mark actually i was typing small a when i typed capital a done how silly mistake it was but tell me is there a way to handle this case sensitiveness in forms
-
You'll find a google search faster than my response.
https://www.google.com.au/search?q=r...ve+LIKE+search