similar to: [ActiveRecord] wrong number of arguments (0 for 2) ?!

Displaying 20 results from an estimated 10000 matches similar to: "[ActiveRecord] wrong number of arguments (0 for 2) ?!"

2006 Apr 22
6
STI and type tables?
So by default to get STI, I would have something like: create_table :items do |t| t.column "type", :string t.column "title", :string end But if I want to store those type values in a separate table, such that I have ... create_table :items do |t| t.column "item_type_id", :string t.column "title", :string
2012 Jun 09
3
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Pleas
Hello, I stumble upon this error when loading a subclass of the Transaction class. For full details, see the pastie: http://pastie.org/4053678 Error message: ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: ''Transactions::DummyDdnlTransaction''. This error is raised because the column ''type'' is reserved for
2007 Feb 12
2
Objects in Arrays? Allowed, right?
Hi: I''m trying to manually append objects to an instance variable that is just an array of objects. Here''s my controller code: @tasks = Task.find(:all, :conditions => "entity_id = #{session[:user].id}") for t in @tasks if Subtasks.find(:first, :conditions => "child_id = #{t.id}") != nil @mtasks << t end end However, when I execute, I
2006 Mar 21
3
Newbie - ActiveRecord relationships
So I''ve worked through Agile Web Development with Rails and I''m now trying my first little app to get into the swing of things. Its a task tracking app where people can create tasks and assign them to others, and also log time against the tasks. I''m having trouble working out the model relationships. This is what I''ve got so far, but its not right as
2007 Mar 28
4
Disabling ActiveRecord "type" column subclassing
Hi! I have a legacy table that has a column named "type" and need to remove this automatic subclassing by ActiveRecord. The api pages are vague about this, and I tried self.inheritance_column = "xtype" which seemed to get me half-way. In the validate_on_create method, the value of self.type was my model Class name. How would you disable this feature? -- Posted via
2008 Dec 20
3
rake aborted (wrong number of arguments)
I''m following a tutorial here to get some columns in my database. I generated a model called ''product'' then I edited ''db/001_create_products.rb'' to have a few columns but when I try to migrate I get this error: bio4054059:depot rmorourk$ rake db:migrate (in /Users/rmorourk/Sites/depot) == CreateProducts: migrating
2007 Nov 07
1
Serialization of ActiveRecord Instances: No Inheritance Column?
Hey, I have been looking at ActiveRecord''s serialization code, and noticed that ActiveRecord::XmlSerializer#serializable_attributes purposely excludes the STI inheritance column per ``options[:except] = Array(options[:except]) | Array(@record.class.inheritance_column).'''' Is there a particular reason for this? Would anyone be opposed to my writing a patch to have this
2010 Oct 15
2
XCP xapi debugging
Good day. Suddenly on pretty high loaded pool with about 50 VM per 5 hosts I got following problem vm does not start and start command silently waiting. xe task-list displays pack of tasks with same status and resident-on: uuid ( RO) : b607ef7b-e185-72d9-4d3a-5795557922fc name-label ( RO): VM.start name-description ( RO): subtask_of ( RO): <not
2007 May 28
5
CTI in ActiveRecord
I search an plugin or gem, but don''t find nothing satisfactory. I believe to be stranger a technology that nails the DRY, have that create you vary equal tables, instead of using inheritance. Exists an soluction for this? I want a solution similar to this: create_table :people |t| do t.column :name t.column :address end create_table :customer |t| do t.column :person_id
2006 Jun 01
4
What i do if i have a table with a column named "type"?
Hi everybody! The class ActiveRecord::Base have a atribute named type and if my table have a column with the same name i get an error if i use model.finde, model.save and more... I dont know what i can do to solve this problem! Someone know? Thanks -- _________ Noel R. Morais
2006 Aug 02
2
mangle ActiveRecord
Dear Gurus on Rails! How do I change the behaviour of one method in ActiveRecord::ConnectionAdapters::SchemaStatements ? Full story: I''d like to mangle ActiveRecord::ConnectionAdapters::SchemaStatements so when it creates a new sql table, it also (optionally) creates my created_at, deleted, key_id, session_id etc columns that I use on basically all tables. It would not be DRY to repeat
2008 Jul 13
2
Problem with ActiveRecord::AssociationTypeMismatch
Hi all ! I''ve written a Character model, each character has many Attributes. My schema.rb looks like this: create_table "characters", :force => true do |t| t.string "first_name" t.string "last_name" t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" end create_table "attributes",
2008 Apr 03
2
Change the value stored in inheritance_column
I have been struggling for quite sometime with this. Is there any way to configure the Model to store user defined value in the inheritance_column instead of the default value (which is class_name) The problem I have is like this: I have a User model and there are different models which inherit from this like Admin, Premium, Professional, etc. Each of these inherited models are identified by a
2006 Aug 23
2
Re: STI and Joins Broken
I''ve made a inheritance rework some weeks ago that would possible fix it since it only loads the inheritance support in the class that''ll use it. In STI case, it would load only if the class that descends directly from AR has been inherited and the column specified in the inheritance_column is available. People here told me to wait until next release so we can dig into this, but
2006 Jun 30
4
ActiveRecord Migrations, without autonumbered PK''s
I love using ActiveRecord Migrations to build tables. Sometimes, I don''t want to use autogenerated PK''s - I want to set them automatically (why? I''m importing read only data from a large list of medications, and want to use the PK''s assigned by the medication research company...). Is there anyway to do this using Migrations? I know that I don''t
2006 Mar 28
2
[Q] How to make a multi-line title with expression()
Dear R-lister Could anyone know how to make a multi-line title for a plot with expression()? In my plot, the title should be writeen in two lines (because it is two long for one line) and it should use a mathematical expression. I tried to use "\n", but "\n" is ignored in expression() call: hist(diffChangeRequestHintsBeforeAnswering[,4], br = 50, xlab = "Skill Change in
2015 Jan 12
3
[LLVMdev] NP-hard problems in the LLVM optimizer?
Hi all. I’ve heard a couple of times that some of the problems solved by various passes in the optimizer are indeed NP-hard, even though the instances are small enough to be tractable (and very quickly). Is this true? If so, which are these problems? Register allocation? Instruction scheduling? Are they solved exactly or by approximations? Or not solved at all (the need of solving them is
2007 Mar 27
2
activerecord failed?
Hello all, i found something wrong (or maybe i was wrong?) this looks like a rectiverecord bug , can anyone help me to point out what''s going on? ------------------migration create_table :books do |t| t.column :name,:string t.column :person_id,:integer end create_table :people do |t| t.column :name ,:string end ------------------model class
2006 Jul 30
3
ActiveRecord - Multiple Address for a single record
I''m trying to figure out the Rails way to model the following problem: I have 2 tables. One (let''s call it location) contains a single address. The other (let''s call it company) contains 3 address. I''m trying to figure out the best way to model this. I''ve created an address table, a set up the model as follows: class Address <
2009 Aug 31
3
Migration - wrong SQL statement is created
Hi, I am doing my first steps with RoR and I have the following problem: I execute my migration file with the following content on a MySQL-database via Rake: <code> class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.integer :id t.string :username, :size => 100 t.string :password, :size => 100 t.string :email, :size