Displaying 20 results from an estimated 900 matches similar to: "has_one with Single Table Inheritance - NameError : uninitialized constant"
2009 Jul 20
2
Hitting unknown error with "can't dup NilClass"
Hi,
My system has been encounter this problem, and I couldn''t find
solution after debugging. My scenario is stated below:
class user
has_many :posts
has_many :comments
end
class post
belongs_to :user
has_many :comments, :as => :commentable
end
class comment
belongs_to :post
belongs_to :user
end
For this case, I am trying to retrieve each post''s comment
2006 Mar 13
0
Problems with association named :task
I have an object that belongs_to :task, and calling that object''s task
method returns the task it belongs to in the unit tests. One place in a
controller, though, it gives me the error:
undefined method `find'' for Rake::Task:Class
./script/../config/../vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb:44:in
`find_target''
2008 May 16
0
attachment_fu and/or rmagick on osx -- weird error
One of our developers is getting a weird error from attachment_fu and/or
rmagick on OSX. And even weirder because he''s used attachment_fu and
rmagick on other projects without difficulty. This all works fine on
debian/ubuntu. See the stack trace below. Any suggestions?
Btw, the code that''s blowing up is retrieving the attachment_fu info.
The presence of image_science in
2009 Sep 09
1
Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch Going Nuts!
Hi,
I have been trying to do this for a few days now and cannot figure it out. I
would be very grateful is anyone can help me
I am trying to upload an attachment to AWS, S3 using paperclip,
however every time I keep getting this error:
ActiveRecord::AssociationTypeMismatch in ProjectController#create_notice
Graphic(#37649720) expected, got Tempfile(#27280470)
RAILS_ROOT:
2009 Sep 10
2
Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch
Hi,
I have been trying to do this for a few days now and cannot figure it
out. I would be very grateful is anyone can help me
I am trying to upload an attachment to AWS, S3 using paperclip,
however every time I keep getting this error:
ActiveRecord::AssociationTypeMismatch in
ProjectController#create_notice
Graphic(#37649720) expected, got Tempfile(#27280470)
RAILS_ROOT:
2006 Jul 28
3
Forms: handle foreign keys (AssociationTypeMismatch)
Hi all
I tried and tried and tried, but I still fail in creating a form with
proper validation and stuff for foreign keys... So I''d really like to
get some help here.
I''m creating a booking site for DJ''s, and for every booking one can
choose one of different countries:
class Booking < ActiveRecord::Base
validates_presence_of :country_id
2008 Jan 24
1
Uploading files: wrong number of arguments (1 for 0)
I am trying to upload a file (pretty simple stuff right?), but keep
getting the argument error.
I have cross referenced what I have to prior uses and cannot find any
errors with what I have.
---------
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_one_association.rb:18:in
`initialize''
2007 Mar 26
5
Session trouble
I am having a problem with an assignment to an object stored in session.
for example when I am in console
o = NewOrder.new
# dl = DeliveryLocation.new
# o.delivery_location = dl #=> returns a delivery location object
# o.delivery_loaction.save #=> returns true
when I am using the controller
delivery_location = DeliveryLocation.new(params[:delivery_location])
2009 Feb 02
4
AssociationTypeMismatch got Fixnum
I''m using rails 2.0.5 and mongrel.
I have a Page and a Source models.
class Source < ActiveRecord::Base
has_many :pages
end
class Page < ActiveRecord::Base
belongs_to :source
end
Basically I''m listing pages with their sources; In production and
development ( I use mongrel_cluster in the first and a single mongrel
on the second) I got this error:
2007 Feb 08
5
a possible bug in Has_many :through using :soucre
I''ve been stumped on this for a few days and I''m not sure if it''s an error
on my end or an actual bug.
I have a system where I have workshops and users. Workshops have students,
presenters, and troubleshooters. I wanted to represent this simply by
using has_many :through with :source.
Workshop
has_many :presenters, :through =>:presenterships, :source=>:user
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed.
CHANGES
-------
Revision 8649 committed by gbuesing on 2008-01-16 20:07:10
Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002
M /trunk/activesupport/CHANGELOG
M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb
M /trunk/activesupport/test/core_ext/date_time_ext_test.rb
TEST FAILURES AND
2006 Jul 24
2
Thread.new with ActiveRecord under Mongrel vs. FastCGI
Hi All,
I''m going to end up hosting a site on a server in a fastcgi environment,
but I''ve been doing most of my development under mongrel. I have a bit
of code that spawns a thread, and in the thread it makes some remote
calls (openuri) and does some database inserts via activerecord.
When I do this under FastCGI, everything appears to work as expected.
When I do it under
2006 Aug 08
1
File upload into Mysql (using lighttpd) problem
Hello All,
I''ve run into a snag. (I apologize in advance. I''m not very good at
system administration.)
I''m building an app that allows users to upload files. Up until now I
have been storing the files on the file system, but tonight I decided to
change the app so the files are stored in the database as a longblob.
I thought everything was working great, until I
2008 Sep 02
1
Deploying Rails patches (diff)
I am having a problem with a belongs_to and a has_one :through relation
which I found is a known bug in Ruby on Rails:
http://rails.lighthouseapp.com/projects/8994/tickets/323-has_many-through-belongs_to_association-bug
This ticket has 6 different attachments. Do I need all of them, or just
the latest one?
I can''t seem to find anywhere how one is supposed to deploy these
patches.
2006 May 19
2
Problems at running Rails at the first time
Well, i got familiar with writing Ruby scripts the last days and thougt to
write a web application with a framework. First steps was Rails.
I successfully installed Gems, Action Web Service and Rails, at least the
installer said so... :D
So I took a tutorial to write a small app, but I fail in the step startig
Rails with the command "rails myappdir". There are some warnings and error
2007 Jan 10
3
ActiveRecord Error?
We spent a big chunk of yesterday hunting down a strange bug in one of
our rails apps and created a test project to try out different theories
on what was going on. The result so far is a very small test case app
that perfectly reproduces the problem. The question is, is there
anything *wrong* with what we''re doing here, or is it a problem with
ActiveRecord? We''re on rails
2006 Mar 24
1
Bug (or feature?) in association_proxy: attributes in conditions
Hi List,
When I do something like
belongs_to :thing, :conditions => ''var = #{my_var}''
method_missing in association_proxy.rb gets recursively called.
Are these bind-style vars not allowed? Given the code in the
conditions method of association_proxy.rb, it looks lilke they''re
meant to be.
I''m running -v 4021 of rails.
Cheers,
Ian
2006 Nov 20
5
RMagick load problems?
I have a page (model: daily_progress_chart) that uses RMagick and
ImageMagick to create a chart using RVG. A few days ago (after some
updates to Rails), this chart stopped working on both my development
machine (MacBook Pro) and the production server (Gentoo Linux). I get
the following error messages. I am totally lost, but I assume that there
is a problem with RMagick. Any ideas anyone?
On
2007 Aug 22
1
mock framework ethics question
Hi James, Jim, and everyone else who''s listening.
I''ve been investigating an interesting bug related to mocks and rails
AssociationProxies. See
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=12547&group_id=797
for details.
The crux is that if you do this (rspec mock syntax):
obj.should_receive(:msg).with(mock_of_a_model)
and the implementation does
2006 Dec 20
4
undefined method `fullname' for #<User:0x357e380>, BUT works on first view?
Hi all,
Please excuse the long post, but I wanted to make sure you have all the
information....
I have a NewsModel that looks like this:
class News < ActiveRecord::Base
belongs_to :user
validates_associated :user
validates_length_of :title, :description, :minimum => 5, :allow_nil
=> false
acts_as_commentable
acts_as_taggable
def self.find_recent
News.find(:all,