similar to: Disabling ActiveRecord "type" column subclassing

Displaying 20 results from an estimated 700 matches similar to: "Disabling ActiveRecord "type" column subclassing"

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 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2006 Mar 22
4
How do I substitute variables into class names?
In a partial that renders another partial, I would like to change the items I am rendering based on the content of a variable. So instead of having 5 partials which all have variations on this; <% for @skill in @cv.skills %> <%= render :partial => "skills" %> <% end %> If item = "skill" would like to do something to this effect; <% eval("for
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
2018 Jan 26
2
utils::install.packages with quiet=TRUE fails for source packages on Windows
Hi, Installing a source package on Windows using utils::install.packages() with quiet=TRUE fails, while it works with the default quiet = FALSE. The problem seems to be caused by the fact that when quiet = TRUE, stdout and stderr are set to FALSE when calling "R CMD INSTALL" with base::system2() here:
2018 Jan 26
1
utils::install.packages with quiet=TRUE fails for source packages on Windows
The obvious guess would be that Rstudio is attempting something like redirecting output and getting itself confused. However, it is pretty clearly Their Problem, no? Rstudio has their own support infrastructure. -pd > On 26 Jan 2018, at 09:17 , Andreas Kersting <r-devel at akersting.de> wrote: > > Just noticed that this problem only occurs from within RStudio (v1.1.414). Any
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 Apr 07
6
validation nightmare
Please help, I am really at a loss at how validation is supposed to work in rails. Model contains acts_as_tree I want to force my NEW objects to have a parent I do NOT want existing object to have a parent so I only want to have parent_id on create, NOT on update. I am trying this: def validate_on_create validates_presence_of :parent_id, :message => "You must specify a
2011 Apr 28
3
difference between validate and validate_on_create
i just ran into a problem with some test, and i am not exactly sure why, but the difference happened when i changed my model validation from: validate :custom_validation to: validate_on_create :custom_validation can someone give me any ideas on where in the chain the validation takes place? thanks! -- Posted via http://www.ruby-forum.com/.
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
2008 Nov 19
2
Where should I put "prerequisite logic"?
Hi there, I have this model called InventoryItem. Every time an InventoryItem is created (through the CharactersController and the create_item action) I need to update others tables and make lookups in other tables, to check if the Character has the prerequisites to actually create the InventoryItem. My problem is that I cannot seem to find a good place to put this logic. I''ve tried to
2014 Jul 04
1
DESCRIPTION.in file causes R CMD check to fail?
hi. i'm building a package using autotools. to propagate the package version number from configure.ac to DESCRIPTION, i'm using a DESCRIPTION.in file. both of these files are "shar"'d below. i need to distribute the DESCRIPTION.in file, as ./configure will need it. but, "R CMD check" wants to look at DESCRIPTION, so i've let that also come into the package
2006 May 04
2
validates :on 2
Hello, I need to have this for :create and :login how do I do so validates_presence_of :login, :password, :password_confirmation, :user_name, :email, :on => :create I do need it to be off in a number of places though -- Posted via http://www.ruby-forum.com/.
1999 Mar 22
3
mksmbpasswd - permissions
Hallo, i installed samba V2.0.3 on a linux server in a company. for better security i will use encypted passwords. for synchronisation of the unix password file and the samba password file i tried out the script mksmbpasswd script. my security settings at the server are easy and i set the permissions of the unix passwd file at 774 and also my smbpasswd file at 744. starting the script with the
2005 Apr 23
7
Validation question
Hi all, Is there a way to invoke validations at times other than save, create and update? I know that I can do this by writing my own validation checks using errors.add_[blah], but I''d like to leverage the existing validation code. What I have is two sets of fields in a record, set A and set B. Both sets must be validated on record create. However, the trouble is that after
2006 Mar 16
2
Verifying existance of related record
Is there an easy way to validate that a related record exists? I''ve got a table that contains a set of categories and I want to make sure the user has entered a vaild category (i.e. a category that exists in the categories table). So in the model of the table I put this: class Master < ActiveRecord::Base belongs_to :category, :foreign_key => "categoryid"
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 Jan 19
2
Easy way to handle form input without a model class?
I have a couple forms that I''d like to be able to validate and automatically populate, but it shouldn''t be based on AR. In fact I often have a bunch of small forms that I can''t really justify writing a whole new model class for anyway. I''d like to validate the form input, and then use rails helpers to automatically populate the form if validations fail.
2006 Dec 07
2
validate_on_destroy ?
What''s the best way to validate_on_destroy. Rails only seems to include validate_on_create and validate_on_update methods. I don''t want to resort to doing: before_destroy do |j| raise "There is an error" if j.etc end Is there a way of finding out what action (create/update/destroy) is being performed if I use the ''validate'' method? -- Posted via
2007 May 27
3
Mac setup issue
I just installed an updated set of tools (ruby, rails, etc) under my home directory for my mac 10.4, since I did not want to disturb the pre-installed environment in case something in the system relies on that. The problem I have is that the rake command is still using the old stack rather than the new one, even though the new rake is there. I presume the ''rake'' command itself