search for: has_many_association

Displaying 20 results from an estimated 32 matches for "has_many_association".

2007 Nov 29
4
collection.build or collection.create gives "ArgumentError: wrong number of arguments (1 for 0)"
...id"=>nil, "created_at"=>nil}, @new_record=true> >> s.tasks.build ArgumentError: wrong number of arguments (1 for 0) from /Applications/Locomotive2/Bundles/ standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/ activerecord-1.15.3/lib/active_record/associations/ has_many_association.rb:13:in `initialize'' from /Applications/Locomotive2/Bundles/ standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/ activerecord-1.15.3/lib/active_record/associations/ has_many_association.rb:13:in `new'' from /Applications/Locomotive2/Bundles/ standardRailsMar2007.locobun...
2007 Jul 19
7
NoMethodError in partial driving me mad
...ontent %> 5: </p> RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ base.rb:1235:in `method_missing'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ associations/has_many_association.rb:111:in `send'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ associations/has_many_association.rb:111:in `method_missing'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ base.rb:946:in `with_scope'' /usr/lib/ruby/gems/1.8/gems/acti...
2009 Jun 04
1
wrong number of arguments (1 for 0)
...9;ve used console to test my models and they all work ok, I can do manually what I''m trying to do with Rails. There is something in the code somewhere outside of the model code that is causing this problem and I''m at a loss to track it down. I''ve traced into the code for has_many_associations.rb: def insert_record(record, force = false, validate = true) set_belongs_to_association_for(record) force ? record.save! : record.save(validate) end and it blows up on the force ? record.save! : record.save(validate) line. Here is the stack trace: wrong numb...
2006 Feb 23
3
has_many reference
...e'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1198:in `id'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1209:in `quoted_id'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/has_many_association.rb:169:in `construct_sql'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/has_many_association.rb:8:in `initialize'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations.rb:753:in `new'' c:/ruby/lib/ruby/gems/...
2009 Sep 09
0
Rails 2.3.4 ActiveRecord association problem
Upgraded our app from Rails 2.2.2 to 2.3.4, and I''m now encountering an error when adding a child to a parent. Top of the stack: wrong number of arguments (1 for 0) /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/ associations/has_many_association.rb:61:in `save'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/ associations/has_many_association.rb:61:in `insert_record'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/ associations/association_collection.rb:119:in `<<'' /Library...
2006 Jul 27
2
Creating multiple objects from form data
I''m in the process of creating a sign up form for an online application. The form collects account info, company info, and then info for an administrative user. The method looks like this: def create @account = Account.create!(params[:account]) @company = @account.companies.create!(params[:company]) @user = @company.users.create!(params[:user]) end However, this inevitably fails
2007 Jun 01
0
"Exception: stack level too deep" on collection.clear?
.../ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/ transactions.rb:121:in `transaction'' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/ transactions.rb:125:in `destroy'' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/ associations/has_many_association.rb:168:in `delete_records'' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/ associations/has_many_association.rb:168:in `each'' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/ associations/has_many_association.rb:168:in `delete_records'...
2008 Mar 07
3
Boolean circles..
...9; from /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1227:in `find_initial'' from /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:502:in `find'' from /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_many_association.rb:66:in `find'' from (irb):3 >> m = c.members.find(:first, :conditions => "is_active = false") ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: false: SELECT * FROM members WHERE (members.club_id = 1 AND (is_active = false)) LIMIT 1 from /Libra...
2006 Dec 22
2
Relating Namespaced Models
...verecord-1.14.4.5618/lib/active_record/base.rb:994:in `find_every'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4.5618/lib/active_record/base.rb:415:in `find'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4.5618/lib/active_record/associations/has_many_association.rb:91:in `find'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4.5618/lib/active_record/associations/association_collection.rb:159:in `find_target'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4.5618/lib/active_record/associations/has_many_ass...
2006 Feb 25
5
MySQL client ran out of memory
.../usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:in `count_by_sql'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:511:in `count'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/has_many_association.rb:49:in `count'' Anyone have any suggestions as to what the issue might be? Thanks, Nick -- Nicholas Van Weerdenburg -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060225/10a16048/attachment-0001...
2006 Feb 10
1
Auto-generated find queries adding bogus WHERE clauses
[Sorry for the poor subject; this is really hard to explain] I''m trying to run a search over several objects which themselves contain multiple model objects, like so: class Collection << ActiveRecord::Base def findpkg self.repositories.each do |r| p = r.packages.find(:all, :conditions => "name like ''%pkg%''") end end end
2007 May 24
3
Annoying problem, stack error
...ems/activerecord-1.15.3/lib/active_record/reflection.rb:125:in `send'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/reflection.rb:125:in `klass'' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/associations/has_many_association.rb:194:in `construct_sql'' ... 30 levels... from /Users/sparta/Projects/work/idastudios/ff/vendor/plugins/rspec/lib/spec/runner/option_parser.rb:154:in `parse'' from /Users/sparta/Projects/work/idastudios/ff/vendor/plugins/rspec/lib/spec/runner/option_parser...
2006 Aug 08
1
File upload into Mysql (using lighttpd) problem
.../1.8/gems/activerecord-1.14.1/lib/active_record/transactions.rb:118:in `transaction'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.1/lib/active_record/transactions.rb:126:in `save'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.1/lib/active_record/associations/has_many_association.rb:143:in `insert_record'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.1/lib/active_record/callbacks.rb:343:in `callback'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.1/lib/active_record/associations/association_proxy.rb:110:in `method_missing''...
2006 Apr 20
1
has_many.count not accepting options hash
...iverecord-1.14.2/lib/active_recor d/calculations.rb:141:in `calculate'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor d/calculations.rb:64:in `count'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor d/associations/has_many_association.rb:47:in `count'' from (irb):21 It appears to call to_s on whatever is passed to it. Is this a bug, normal behavior, or am I doing something wrong? Thanks. -- Jack Christensen jackc@hylesanderson.edu
2006 Apr 16
8
"Cannot convert String to Integer" after using association
...1.13.2/lib/active_record/associations/association_proxy.rb:75:in `send'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/association_proxy.rb:75:in `method_missing'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/has_many_association.rb:90:in `method_missing'' (eval):1:in `id'' #{RAILS_ROOT}/app/views/main/_entity.rhtml:27 #{RAILS_ROOT}/app/views/main/index.rhtml:30 #{RAILS_ROOT}/app/views/main/index.rhtml:29:in `each'' #{RAILS_ROOT}/app/views/main/index.rhtml:29 This is really starting to tick me off...
2007 Feb 08
5
a possible bug in Has_many :through using :soucre
.../lib/active_recor d/base.rb:1506:in `initialize_without_callbacks'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2 /lib/active_recor d/callbacks.rb:225:in `initialize'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2 /lib/active_recor d/associations/has_many_association.rb:13:in `build'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2 /lib/active_recor d/associations/association_collection.rb:93:in `create'' from (irb):5 I''ve pasted my classes below. The migrations are standard (presenterships just has its own id...
2007 May 30
2
ActionView::TemplateError
...compute_type'' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ reflection.rb:125:in `send'' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ reflection.rb:125:in `klass'' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ associations/has_many_association.rb:174:in `construct_sql'' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ associations/has_many_association.rb:6:in `initialize'' #{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ associations.rb:998:in `new'' #{RAILS_ROOT}/vendor/rails/activ...
2006 Jan 19
7
bug in has_many count?
I can submit a patch, but wanted to confirm I''m looking at this right... The docs indicate that if you specify a has_many association with :finder_sql, but no :counter_sql, it constructs the appropriate counter sql by substituting the SELECT clause. But has_many_association.rb doesn''t seem to do that -- it just passes Base#count_by_sql the finder_sql, which doesn''t work so good. def count(runtime_conditions = nil) if @reflection.options[:counter_sql] @reflection.klass.count_by_sql(@counter_sql) elsif @reflection....
2007 Oct 08
1
Rails reverses apostrophes
Hi, I am quite new to Ruby on Rails so this might have a very simple answer... My problem gives the following error message when I try to call the count function for an item. Mysql::Error: Unknown column ''TournamentTemplate'' in ''where clause'': SELECT count(*) AS count_all FROM action_logs WHERE (action_logs.loggable_id = 1 AND action_logs.loggable_type =
2007 Jan 05
6
RSpec 0.7.5 with Rails and rcov
I seem to be missing something because I am at a loss on how to get rcov, RSpec, and Rails working together. Would someone mind dropping some hints?