Displaying 20 results from an estimated 38 matches for "association_collect".
2008 May 12
3
Enumeration sum
...d.inject(0) { |sum, player| sum + player.value }
but not this:
@sum = @selected.sum { |player| player.value }
@sum = @selected.sum(&:value)
The last two give me following error:
wrong number of arguments (1 for 2)
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_collection.rb:164:in
`calculate''
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_collection.rb:164:in
`send''
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_collection.rb:164:in
`method_missing''
/...
2010 Sep 01
0
Error on update_attributes with HABTM relationship
...everything is fine. I''m
stumped. Here''s the last couple of lines from the trace, in case it''s
helpful:
activerecord (3.0.0) lib/active_record/associations/
association_proxy.rb:260:in `raise_on_type_mismatch''
activerecord (3.0.0) lib/active_record/associations/
association_collection.rb:522:in `block in remove_records''
activerecord (3.0.0) lib/active_record/associations/
association_collection.rb:522:in `each''
activerecord (3.0.0) lib/active_record/associations/
association_collection.rb:522:in `remove_records''
activerecord (3.0.0) lib/active_recor...
2005 Dec 21
2
ActiveRecord Error with << in Collection
...get a following error:
ActiveRecord::AssociationTypeMismatch in Cmdb#create
ConfigurationItemAttributeValue expected, got Array
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/association_collection.rb:128:in
`raise_on_type_mismatch''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/association_collection.rb:114:in
`replace''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/association_collection.rb:114:in...
2010 Oct 11
8
Nooby Stuck - "has_and_belongs_to_many" relationship
...arel/algebra/relations/relation.rb:159:in `insert''
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.0/lib/active_record/associations/has_and_belongs_to_many_association.rb:70:in `insert_record''
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_collection.rb:136:in `<<''
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_collection.rb:479:in `add_record_to_target_with_callbacks''
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_coll...
2006 Apr 04
1
habtm and options_from_collection_for_select [1.0.0]
I ran into a problem using options_from_collection_for_select :
ActiveRecord::AssociationTypeMismatch (Topic expected, got String):
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/
active_record/associations/association_collection.rb:128:in
`raise_on_type_mismatch''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/
active_record/associations/association_collection.rb:114:in `replace''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/
active_record/associations/association_co...
2006 Jan 23
0
type mismatch because of misled array index
...es/TRAVELDRIVE/sandcastle/script/../config/..
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:115:in
`raise_on_type_mismatch''
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:24:in
`<<''
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:23:in
`each''
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:23:in
`<<''
#{RAILS_ROOT}/vendor/rail...
2007 Jun 01
0
"Exception: stack level too deep" on collection.clear?
...e.actors.clear
end
def my_other_method
... kase.case_causes.clear
end
Also, Actor and CaseCause both have observers on them that attempt to
update CourtCase.
---------------------
Exception: stack level too deep
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/
associations/association_collection.rb:69:in `clear''
(eval):3:in `destroy_without_habtm_shim_for_actors''
(eval):4:in `destroy_without_habtm_shim_for_actors''
(eval):4:in `destroy_without_callbacks''
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/
callbacks.rb:321:in `destroy_...
2009 Nov 17
5
has_many :through and foo.bars.include?
...gems/activerecord-2.3.4/lib/
active_record/base.rb:2006:in `expand_id_conditions''
from /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.4/lib/
active_record/base.rb:692:in `exists?''
from /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.4/lib/
active_record/associations/association_collection.rb:380:in `send''
from /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.4/lib/
active_record/associations/association_collection.rb:380:in
`method_missing_without_paginate''
from /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.4/lib/
active_record/base.rb:2143:in `wi...
2006 Jan 22
2
acts_as_taggable: weird SQL problem with untagging
Setup as follows:
class Resource < ActiveRecord::Base
belongs_to :user
validates_presence_of :filename
validates_uniqueness_of :filename, :scope => "user_id",
:message => "already exists, try uploading another file or deleting first."
acts_as_taggable :join_class_name => ''TagResource''
2006 Feb 27
1
Nested hash from form params into create()?
...INTEGER UNSIGNED NOT NULL,
optional_id INTEGER UNSIGNED NOT NULL
);
## ERROR ##
CartItemOptionalVariation expected, got Array
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/association_collection.rb:128:in
`raise_on_type_mismatch''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/association_collection.rb:114:in
`replace''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/association_collection.rb:114:...
2007 Jun 23
3
has_and_belongs_to_many and dynamic find
...does
find_by_name blow up ?
Cheers all,
tom
The full trace is here
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
associations/association_proxy.rb:148:in `raise_on_type_mismatch''
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
associations/association_collection.rb:24:in `<<''
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
associations/association_collection.rb:23:in `each''
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
associations/association_collection.rb:23:in `<<''
C...
2006 Aug 15
0
SystemStackError: stack level too deep
...lidations.rb:744:in
`save''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:160:in
`insert_record''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:26:in
`<<''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:23:in
`<<''
from
./script/../config/../config/../vendor/rails/activerecord/lib/active_record/connection_adapters/...
2008 Jul 13
2
Problem with ActiveRecord::AssociationTypeMismatch
...tionTypeMismatch: Attribute(#17724630) expected,
got Array(#104100)
from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
associations/association_proxy.rb:214:in `raise_on_type_mismatch''
from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
associations/association_collection.rb:229:in `replace''
from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
associations/association_collection.rb:229:in `each''
from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
associations/association_collection.rb:229:in `replace'...
2010 Jan 26
2
accepts_nested_attributes_for :has_many :through => 'bug?'
...expected, got Array(#2148226700)
RAILS_ROOT: /Users/mark/Programming/ruby/s/
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/
associations/association_proxy.rb:263:in `raise_on_type_mismatch''
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/
associations/association_collection.rb:320:in `replace''
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/
associations/association_collection.rb:320:in `each''
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/
associations/association_collection.rb:320:in `replace''
/Library...
2006 Apr 04
2
HABTM
...#<Item:0x266b13c>
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
/dp/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/=20
base.rb:1786:in `method_missing''
/dp/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/=20
associations/association_collection.rb:117:in `replace''
/dp/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/=20
associations.rb:884:in `items=3D''
#{RAILS_ROOT}/app/controllers/items_controller.rb:15:in `select''
/dp/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/=20
base.rb:178...
2008 Nov 06
10
Rails 2.1.2 bug in include on has_many?
...associations''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/base.rb:1347:in
`find_every''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/base.rb:540:in
`find''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/associations/association_collection.rb:47:in
`find''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/associations/association_collection.rb:308:in
`find_target''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/associations/association_collection.rb:262:in
`load_target''
/us...
2007 Oct 23
1
storeconfig DEPRECATION WARNING
...WARNING: Calling .create on a has_many association without
saving its owner will not work in rails 2.0, you probably want .build
instead See http://www.rubyonrails.org/deprecation for details. (called
from create at
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/associations/association_collection.rb:95)
perhaps it can be interesting to someone ?
--
Cordialement,
Ghislain
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users
2009 Sep 09
0
Rails 2.3.4 ActiveRecord association problem
...rd-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/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/
associations/association_collection.rb:433:in
`add_record_to_target_with_callbacks''
My code (in snippets):
class Trip < ActiveRecord::Base
has_many :activity_reservations
end...
2006 Aug 08
1
File upload into Mysql (using lighttpd) problem
...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/associations/association_collection.rb:26:in
`<<''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.1/lib/active_record/associations/association_collection.rb:23:in
`<<''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.1/lib/active_record/connection_adapters/abstract/database_statements...
2007 Dec 04
10
ActiveRecord::AssociationTypeMismatch
...ecord::AssociationTypeMismatch (TaskUser expected, got TaskUser):
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/associations/association_proxy.rb:148:in
`raise_on_type_mismatch''
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/associations/association_collection.rb:24:in
`<<''
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/associations/association_collection.rb:23:in
`each''
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/associations/association_collection.rb:23:in
`<<'&...