This project is archived and is in readonly mode.
Rails3 RC - Associations (has_one, has_many) does not work with models that are based on database views.
-
Carl Tashian
With postgresql this errors out slightly differently:
Model.size
SQL (0.8ms) SELECT COUNT(*) FROM pg_tables WHERE tablename = 'v_my_view_name'
NoMethodError: undefined method
size' for Model(Table doesn't exist):Class<br/>from /Users/carl/.rvm/gems/ruby-1.9.2-rc2@og/gems/activerecord-3.0.0.rc/lib/active_record/base.rb:963:in `method_missing'This could very well be a bug in the pg gem, though!
-
Robert Pankowecki
For me the error was exactly the same on postgresql and sqlite. Maybe something changed in later version...
-
Sen
i got the same error on mysql2.
-
Andrew White
- Assigned user set to Aaron Patterson
- Importance changed from to Low
Hey guys, can someone come up with a test case for this please?
RC2 is coming soon and if you'd like this fixed the help would be appreciated. -
Robert Pankowecki
Yes, we can! :-) I can do it tomorrow (CET).
-
Jeremy Kemper
- Milestone cleared.
- State changed from new to open
-
Aaron Patterson
- State changed from open to needs-more-info
Using the code provided in this ticket and ruby 1.9.2-p0, I was not able to reproduce this bug.
I am working against arel master and rails master. Would you mind trying with edge rails / arel?
-
Robert Pankowecki
How can I use latest rails in my project to reproduce it ?
This is in my Gemfile:gem 'rails', :git => 'git://github.com/rails/rails.git'but running
bundle install
leads to:
Updating git://github.com/rails/rails.git Fetching source index for http://rubygems.org/ Bundler could not find compatible versions for gem "activesupport": In Gemfile: rails depends on activesupport (~> 3.0.0) rails depends on activesupport (3.1.0.beta) -
Neeraj Singh
Fix is mentioned here.
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets...
-
Robert Pankowecki
I checked that it works fine with Rails 3.0 final release and with master. You can close it.