Displaying 20 results from an estimated 7000 matches similar to: "ArgumentError on model create statement"
2009 Jun 17
2
validates_uniqueness_of fails on STI in Rails 2.3.2
I''ve got something like this:
class Position < ActiveRecord::Base
end
class CartItem < Position
validates_uniqueness_of :product_id
end
When I try to save CartItem I get this error:
ArgumentError: wrong number of arguments (1 for 2)
from
/home/joaz/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:758:in
`exists?''
from
2009 Nov 13
3
Encoding::UTF_8 missing?
I''ve just done a fresh reinstall of OS X Snow Leopard on my mac, and I''m
having all kinds of problems with Rails, but the latest problem has me
stumped.
Whenever I run rake db:seed to populate my database I hit the following
error:
** Invoke db:seed (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:seed
rake aborted!
uninitialized constant
2009 Apr 01
1
Erro de update no rails 2.3.2
Pessoal, estou precisando de ajuda...
Estou usando o rails 2.3.2.
Quando tento fazer qualquer update (método save em um registro
existente), recebo o erro abaixo:
ArgumentError in RequisicaosController#enviar_rede
wrong number of arguments (3 for 1)
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/
base.rb:2875:in `attributes_with_quotes''
2008 Dec 20
9
Upgrade to Rails 2 - problem with "save" (MySQL boolean issue?)
I have been working through an upgrade of my 1.2.6 application to
2.2.2.
I am almost there but I have hit a problem with ActiveRecord.
Before the upgrade, the following code was working fine.
def create_root(administrator)
root = create_root_collection(self.pingee_name,
administrator,
2009 Nov 04
0
The error occurred while evaluating nil.prefetch_primary_key
The error occurred while evaluating nil.prefetch_primary_key?
Hi,
I have a problem with a model when I have 3 belongs_to relations in one
the middle.
This example is a subset of a grid-routing project:
n 1
1 n +------------ Project
Connection ------- ConnectionCost
+------------ WaySearchRun
2009 Mar 05
7
issue with the object cache
Hi,
I am getting a method_missing error when I run my application in the
production environment unless I set config.cache_classes = false in
config/environments/production.rb. This happens in Rails 2.2.2 but not
in Rails 2.1.0. The method that is missing is one I used to have
before I edited by hand the migration that creates the table
associated with the object (I know you are discouraged to do
2013 Oct 23
0
Error: allocator undefined for Proc
I had this problem all of a sudden, just changed some puppet classes in my
modules, but no particular stuff or no error in the catalog creation.
Env :
Puppet master version 3.2.0-rc1
Centos kernel 2.6.32-279.11.1.el6.x86_64
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Info: Caching catalog for jbossvdbmaster.prod.italy.cloudlabcsi.eu
Debug: Searched for resources in 0.01 seconds
Debug:
2011 Dec 01
5
Validation failed: Host already has a report for time and kind
Howdy,
I''ve been getting this issue for about a month in dashboard. All our
nodes poll on a cronjob between 00:00 and 01:00 daily, but one node
has been getting this as a failed task for a while, with the yaml
files building up on the server. Outside of this one cronjob, other
puppet runs on the same node are running just fine. The backtrace on
dashboard is:
Importing report
2012 Aug 14
1
NoMethodError: undefined method `accept' for nil:NilClass
Here''s the trace,
NoMethodError: undefined method `accept'' for nil:NilClass
from
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
`to_sql''
from
2009 Jun 04
1
wrong number of arguments (1 for 0)
Hi,
I hope someone can help me because this is driving me crazy, I''ve
spent hours trying to track this down. I''m trying to convert a Rails
1.1 to Rails 2.3.2 and I''m getting the following error when trying to
save a many to many relationship. I''ve double checked all the
associations, I''ve used console to test my models and they all work
ok, I can do
2010 Mar 22
0
rspec bug, on Mysql::Error: MySQL server has gone away: ROLLBACK TO SAVEPOINT active_record_1
hello
can anybody help me with this bug, (this sometimes occur sometimes passes)
1)
ActiveRecord::StatementInvalid in ''MailReader on Simple Tasks should not
accept duplicate email''
Mysql::Error: MySQL server has gone away: ROLLBACK TO SAVEPOINT
active_record_1
/home/poldz/.gem/ruby/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract_adapter.rb:219:in
2012 Sep 18
2
undefined method `to_sym' for nil:NilClass
Hi all,
I am trying to upgrade my rails 2 app to 3 and am getting this error
when trying to login:
NoMethodError in AuthenticateController#authenticate
undefined method `to_sym'' for nil:NilClass
The stack trace is:
activerecord (3.2.2) lib/active_record/validations/uniqueness.rb:26:in
`validate_each''
activemodel (3.2.2) lib/active_model/validator.rb:153:in
2008 Sep 12
1
ArgumentError: Unknown key(s): dependant
Hello,
I came across an association error today with facebooker.
class Cover < ActiveRecord::Base
belongs_to :album
end
class Album < ActiveRecord::Base
has_one :cover, :dependent => :destroy
end
At the console:
>> Album.find :first
ArgumentError: Unknown key(s): dependant
from
2007 Nov 29
4
collection.build or collection.create gives "ArgumentError: wrong number of arguments (1 for 0)"
I have a Project that has_many Tasks. Tasks belongs to a Project. When
I try the following:
project = Project.new
project.tasks.build
I get:
>> s = Project.new
=> #<Project:0x25f9e28 @attributes={"name"=>"", "end_at"=>nil,
"updated_at"=>nil, "published_at"=>nil, "user_id"=>nil,
2011 Feb 09
0
Mysql2::Error: SAVEPOINT active_record_1 does not exist
Hi,
I''m switching the database of a rails 3 app I have developed from
postgres to mysql so that I can avail of amazon''s rds. Before I make
the change I have been running my test code using mysql on my dev
machine with the mysql2 adaptor . My test code is throwing up some
errors that I haven''t quite been able to get to the bottom of yet.
Basically I have a model that is
2010 Dec 10
0
Encoding issues when uploading files
Hello everybody,
I have some troubles with uploading files in my Rails project.
I use Rails 3, Ruby 1.9.2, rack 1.2.1, and both webrick / passenger on
apache
I was investigating and have isolated the strange behaviour on a
simple empty project:
view:
<% form_tag({:action => ''upload''}, :multipart => true) do %>
<%=text_field_tag :desc %>
2010 Sep 01
0
Error on update_attributes with HABTM relationship
Hope someone can tell me what''s up, because this has me baffled.
I have an Image model, and a Provider model. Both are defined as
"has_and_belongs_to_many" relating to each other. In my image form
partial, I have a bit of AJAX generating the provider_ids array
dynamically from a provider AJAX search on the same page.
So for example, each time I click on a provider name that
2005 Dec 16
0
ArgumentError on create
I have several validations applied to my model:
class Quote < ActiveRecord::Base
has_many :files
validates_presence_of :title, :source, :quote, :message => "Missing
Field Required"
validates_length_of :title, :source, :maximum => 80, :message =>
"Maximum Length 80 characters"
validates_inclusion_of :year, :in=>1911..2006, :message => "Year must be
2010 Sep 27
0
problem with set_sequence_name please help
I''m building rails 3 with legacy oracle 10g db. which it''s sequence is
non rails convension.
I have try this.
class AdCourt < ActiveRecord::Base
set_sequence_name ''COURT_SEQ''
end
with rails console :
AdCourt.sequence_name I have got "COURT_SEQ" which look ok.
When
AdCourt.create!(:caption => ''AAAA'', :code =>
2006 Feb 14
1
ArgumentError in <controller not set>#<action not set> ??
Has anyone ever seen this before? It doesn''t happen n a predictable
manner, and can occur via different controllers. Someone else posted
about this back in December but no one replied. I''m completely stumped!
Here is the text, thanks.
ArgumentError in <controller not set>#<action not set>
undefined class/module CustomerDomain
RAILS_ROOT: script/../config/..