I think you missed to reset your database using rake db:reset after having
changed the model name & the corresponding migrations.

Thanks & Regards,
Dhruva Sagar.




On Tue, Nov 10, 2009 at 9:01 AM, Lady Hawk <[email protected]
> wrote:

>
> I have a model called "Media", database table "Medias". I had to rename
> that model to "Medium" and the database table to "Mediums".
> and now when I run my application , I get the following error:
>
> ActiveRecord::StatementInvalid in MediumsController#index
> SQLite3::SQLException: no such table: media: SELECT * FROM "media"
>
> Application Trace:
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract_adapter.rb:219:in
> `log'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in
> `execute'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/sqlite_adapter.rb:417:in
> `catch_schema_changes'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in
> `execute'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/sqlite_adapter.rb:320:in
> `select'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
> `select_all_without_query_cache'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
> `select_all'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in
> `cache_sql'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
> `select_all'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:661:in
> `find_by_sql'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:1548:in
> `find_every'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:615:in
> `find'
>
> C:/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:635:in
> `all'
>
> C:/IR/rails_apps/work/ProjectBroadcast/app/controllers/mediums_controller.rb:6:in
> `index'
>
> Note: I am using sqlite3
>
> I don't have any table called 'media' in my application, I wonder why
> its doing a select from that table
>
> I tried rake db:migrate:reset  and it was successful.
>
> Any help is hugely appreciated
>
> Thanks!
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to