similar to: single table inheritance: change object ''type'' after create?

Displaying 20 results from an estimated 10000 matches similar to: "single table inheritance: change object ''type'' after create?"

2005 Dec 29
9
Single Table Inheritance
Hi all, Quick question for STI. With the following setup: class Company < AR::Base; end class Firm < Company; end Why does Firm.find(:all) return all Companies, not just those that have type==''Firm''? -- Alex
2006 Apr 03
6
problems with Rails 1.1 observe_field :with serialized
I''d like to use observe_field to watch a field, and then when it changes send the entire form to the server. I had been using <%= observe_field ''entity_name_''+@account.id.to_s, :frequency => 0.5, :update => ''auto_complete_''+@account.id.to_s, :url => { :controller => ''committees'', :action=>
2005 Dec 19
8
Single Table Inheritance question
Hello, I''m having a heck of a time getting Single Table Inheritance to work in my app. I have the following models and have scaffolded out Person and Contact. person.rb class Person < ActiveRecord::Base has_many :contacts end client.rb class Client < Person end contact.rb class Contact < ActiveRecord::Base belongs_to :person end phone.rb class Phone < Contact end In
2006 Jul 06
5
Single table inheritance
I''m having a class called Person, with subclasses as goalkeeper, forward, defender. Now a person can be a forward as well as a defender or a goalkeeper. I want to use single table inheritance like : class Goalkeepr < Person end And not have multiple boolean columns like in my people table like is is_goalkpeer, is_forward, is_defender. How do I go about it ? Thanks, Pratik -- rm
2017 Oct 18
1
2018 ASA Computing/Graphics: Chambers Software Award and Student Paper Competition
Dear R-help Listers, The following two student competitions are of interests to the now many student R package developers. I'd appreciate your help in spreading them. #1. John M. Chambers Statistical Software Award 2018 The Statistical Computing Section of the American Statistical Association announces the competition for the John M. Chambers Statistical Software Award. In 1998 the
2006 Jul 26
3
Polymorphic Association with Single Table Inheritance?
Hello, is it possible to setup a model/table schema like this: Groupable --> Membership <-- Group ^ ^ | | User UserGroup I tried the following but failed: Groupable (table with ''type'' column) has_many :memberships, :as => :groupable has_many :groups, :through => :memberships
2006 Jul 31
3
Polymorphic associations and single table inheritance
Running into an interesting problem that at first glance appears to be a bug in the AR association code. However, it''s explicitly coded this way so I''m not so sure. I have some code like this: class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end class Person < ActiveRecord::Base has_many :addresses, :as => :addressable,
2005 Nov 30
8
nested attributes with update_attributes()
Hi, I am trying to use the update_attributes on object with nested attributes and I am getting the following error: ProductPrice expected, got HashWithIndifferentAccess Here''s the situation (simplified): class Product < ActiveRecord::Base belongs_to :productPrice end class ProductPrice < ActiveRecord::Base has_one :product, :dependent => true
2006 Mar 18
1
Fixtures and single table inheritance
I''m wondering what the accepted method for doing unit tests on STI models is. I tried to create a fixture for the class but Rails tries to load that data into the non-existent child table. I could create a fixture named for the real, parent table, but then it would be very difficult to test for the individual functionality and integrity of each sub-class. I saw this page
2009 Feb 23
1
[S] ASA Southern California Chapter Applied Statistics Workshop
The workshop organizing committee of the Southern California Chapter of the American Statistical Association announces the 28th Annual Workshop in Applied Statistics. Professor Colin Cameron from the department of Economics at UC Davis will give a one-day workshop titled "Advances in Count Data Regression." The event will take place on Saturday, March 28, 2009 at UCLA. Details on
2009 Oct 20
1
New Award Announcement ASA Stat Comp/Graph Sections: The Statistical Computing and Graphics Award
The Statistical Computing and Graphics Award The ASA Sections of Statistical Computing and Statistical Graphics have established the Statistical Computing and Graphics Award to recognize an individual or team for innovation in computing, software, or graphics that has had a great impact on statistical practice or research. Typically, awards are granted bi-annually. The prize carries with it a
2006 Jan 06
3
Single table inheritance - HowTo?
Hi, As per another member''s suggestion, I''m trying to user STI. So I have this table: CREATE TABLE `settings` ( `id` int(11) unsigned NOT NULL auto_increment, `type` char(40) NOT NULL default ''General'', `name` char(40) NOT NULL default '''', `value` char(128) NOT NULL default '''', `updated_on` datetime default NULL,
2006 Jan 03
5
update command not updating DB
I really need your help guys... I spent 6 hours on this simple update command today that should work. It works fine in my other controller, but doesn''t work in this one for some reason. Here is my controller code for the list view, and then the update command: ====== def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) if
2015 Mar 26
2
snmpwalk Mixed Fail
Hi All, I have a C6 (latest patches) physical machine that I use for network and server monitoring, predominantly over SNMP. It is on VLAN80. My network management interfaces on the switches are on VLAN50 with routing between the VLANs. I recently changed the router to a CISCO ASA 5505 (reasonably recent IOS version, certainly post HeartBleed), with the management interface on a higher
2006 May 21
2
acts_as_taggable and single table inheritance
I''ve set up a couple of STI models like such that we get something like this... class A < AR:Base class B < A acts_as_taggable class C < A acst_as_taggable (using the acts_as_taggable plugin) I can tag things just fine this way, the problem I encounter is that the taggings are listed with the base class ("A") and not the appropriate subclass ("B"
2003 Feb 11
2
Samba + LDAP = Misery
I have been working on this for weeks now and feel like I am at a dead-end. I am using Samba 3.0 (Head) and OpenLDAP (2.0) and smbldap-tools 0.7 and cannot join either a Linux machine or Windows 2000 machine to the domain. If any of you have some ideas they would be much appreciated. Highlights: - I have a root defined (UID and GID of 0). - Trying to join the domain will successfully add my
2006 Oct 13
1
Edge rails, single table inheritance and keeping multiple classes in a single file
So is the official stance as per edge rails that multiple class definitions must go into separate files? I was trying to use STI with acts_as_attachment, to have all my attachment classes go into a single file, for example: attachment.rb class Attachment < ActiveRecord::Base end class UserPicture < Attachment belongs_to :user, :foreign_key => ''owner_id''
2006 Aug 30
1
Single Table Inheritance with self-referential join
Please tell me if this train of thinking makes sense, I need help on solving this association model problem: I am doing an app that creates and manages stereoscopic images, one stereoscopic image is formed by two photos, say photo1 and photo2 The user uploads photo1 and then photo2 and gets a preview if he likes the preview he/she authorizes it and gets a final stereoscopic image All this
2005 Apr 20
4
acts_as_list and single table inheritance
in a single table inheritance model, rails will automatically set the scope for acts_as_list to the ''type'' field as well as any other scope conditions we provide. Is there a way to disable this? i want to use STI but I want acts_as_list to disregard the class type when getting/setting positions. thanks alan
2006 Apr 03
1
Single table inheritance and relations
All, I''ve a question concerning STI in Rails. Let''s say I''ve a Person class and two classes that inherit from Person: User and Customer. In the DB I''ve the people table to store both instances of User and Customer. Now, let''s say I also have Address class, which references a Customer, and each customer has many addresses. How should I name the