Displaying 20 results from an estimated 300 matches similar to: "Severe STI, HABTM with Attributes and 1.1"
2006 Jan 01
0
Join table with attributes
Hi folks,
I''m trying to migrate a less-than-ideal schema for a Rails app that helps
role-playing gamers (the pencil-and-paper type) connect with each other, at
http://findplay.anvilwerks.com (the source is available there too, for the
curious).
The schema currently uses columns for played_games, wanted_games, and
favorite_games in the players table; each of these holds a foreign key to
2006 Sep 22
2
possible to create polymorphic relationship with STI models?
I would like to associate a ‘product’ model with 3 models inherited from
‘image’: part, action and accessory.
I have it working with Has_many :through relating products to images
through attachments, I then have to determine the ‘type’ of the STI
extension. This means i have to go product.images. While this is ok, i
can see it getting tricky when i want to go products.images <<
2016 Aug 26
0
[PATCH v8 16/18] ARM: DT: STi: stihxxx-b2120: Add DT nodes for STi audio card
This patch enables the uniperif players 2 & 3 for b2120 boards
and also adds the "simple-audio-card" device node to interconnect
the SoC sound device and the codec.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen at st.com>
Signed-off-by: Peter Griffin <peter.griffin at linaro.org>
---
arch/arm/boot/dts/stihxxx-b2120.dtsi | 45 ++++++++++++++++++++++++++++++++++++
1
2016 Aug 26
0
[PATCH v8 13/18] ARM: STi: DT: STiH407: Add sti-sasg-codec dt node
This patch adds the dt node for the internal audio
codec IP.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen at st.com>
Signed-off-by: Peter Griffin <peter.griffin at linaro.org>
---
arch/arm/boot/dts/stih407-family.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi
index 45cab30..d1258d5
2006 Aug 04
2
problem eager loading with sti
Here''s the setup (working off Rails 1.1.4):
Class Project
belongs_to :employee
Class Employee < Person
has_many :projects
When I try to paginate(:employees, :include =>
:projects) I get the error "Association named
''projects'' was not found; perhaps you misspelled it?"
I can :include other models that the Person class
has_many or habtm of, and if I
2006 Aug 05
0
STI or Serialize attributes to one column?
I''m considering serializing attributes of extended classes to one column
instead of using STI.
Each of the extended classes will have associated views to render the UI
based on the serialized params. The references to the associated views will
be stored in the model. I don''t need to query the params.
I''d like to hear about any pitfalls and experiences of others who may
2006 Jul 28
0
STI hiding attributes
I''ve written an extension to AR to allow hiding of attributes(aka
columns) in AR objects. If there''s interest in it I''ll roll it up
into a plugin. Here''s an example:
(straight from Agile Web Dev)
# The table
create table people (
id int not null auto_increment,
type varchar(20) not null,
/* common attributes */
name varchar(100) not null,
email
2006 Apr 01
1
STI with_scope on parent - bug or feature?
Hi,
It seems that setting a with_scope on the parent class doesn''t do anything
MyClass.with_scope(:find=>{:conditions=> ["somecol = ?", ''val'']}) do
@ext_pages, @ext_rows = paginate :my_extended_class, {
:per_page => 13
}
end
# this doesn''t generate WHERE somecol=''val''
In order for scope to work you have to call
2006 Apr 02
0
STI and through
I''m trying to understand how to do the following, but am finding myself stuck.
I have three main tables; here are the first two:
CREATE TABLE reference_items (
"id" integer primary key,
"type" varchar(20),
"title" varchar(255),
"year" year(4)
);
CREATE TABLE "agents" (
"id" integer primary key,
"type"
2006 Mar 08
0
combining STI + polymorphism + rich self HABTM : how to ?
Hi all,
I need to model simple typed polymorphic relations:
''John'' [''works_for''] ''Bill''
''John'' [''speaks_for''] ''Microsoft''
''Microsoft'' [''hold_shares_of''] ''Apple''
I''m having a hard time combining :
- S.T.I.
2006 Mar 16
1
Problem with STI and validation
OK. Here''s another one on STI (thanks for the help of all of you with my
previous STI question, and I promise to update the wiki with the info).
I''m having a prob with validation with the sub-classes. It''s a bit
long-winded to explain, but I''ll post all the logs and code if there''s
no obvious answers. Basically, however, I have validation on the
2006 Mar 22
3
STI and ActiveRecord attributes unprotected
Hi,
This does not seem to be covered anywhere. Since base class extends
ActiveRecord with a table that has fields for all heirs, would that mean
that any heir class can access any of those attributes, including ones
that belong to other heirs?
Or I am missing something?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 07
0
Article: Fun with STI
http://kylemaxwell.com/articles/2006/02/06/fun-with-single-table-inheritance
I wrote an article about how to use rails and single table inheritance
to implement multi-page web forms with incremental validation. I''m
looking for any feedback, and I hope that the development technique is
useful.
I just ran through the tutorial myself, and everything is working for
me on my
2006 Feb 22
0
STI and Inheritance
Hello ~
I have run into an issue with some of my objects not behaving as I expect.
Basically I am using STI on my Users table and have several types of users.
BaseUser
--UserType1 < BaseUser
--UserType2 < BaseUser
etc....
Recently when I create a UserType object and save it to the database it
ignores the validation rules for the parent class BaseUser. Furthermore the
after_validation
2006 Jan 02
0
Best practice for registering/discovering STI subclasses?
Folks,
I''m fairly new to Rails, and I''ve Googled around for an answer to this
question with no luck...
Consider a little blog application that has uses single-table
inheritance for the handful of different content types via a Content
base class and subclasses like FooContent and BarContent. That part
all works well for me.
Now consider the view that presents actions to the
2006 Jan 10
0
bug? : STI and :include => fk and class_name MUST be specified
I suspect this is a bug. Or a limitation.
Problem:
----------------
When you include a STI class in a ''find'' :
@results = Result.find :all, :include => :event
, you are forced to specify the fk and the class name :
belongs_to :event , :class_name => "Event", :foreign_key =>
"event_id"
.
Full code:
-----------
class Event <
2006 Jan 25
0
Changing the instantiated table when using STI
Is there any way to get AR to instantiate a different class when using
STI? Where it would normally instantiate Digit, I would like it to
instantiate SkelDigit. Here''s why...
My rails app has the following STI hierarchy:
Digit < Glyph < ActiveRecord::Base
My migrate script can''t use those classes directly however (backward
compatibility issues), so I created some
2010 May 07
1
Can't eagerly load a polymorphic association defined in an STI parent class?
If I define an association (in my case a polymorphic one) in an STI
parent class, and try to eagerly load it in a subclass, I get the
following error:
ActiveRecord::ConfigurationError: Association name ''myassoc'' was not
found; perhaps you misspelled it?
If I redefine the same association again in the STI subclass, it
works.
Is this a bug or what?
--
You received this message
2008 Jan 27
0
Using acts_as_list, acts_as_tree, and STI in one model
Check it out y''all:
http://rafb.net/p/NJg5U147.html
(pastie was down)
I''m trying to make a tree which belongs_to another model, where you can
have sections or items as children, and sections can have sections or
items as well. Moreover, any siblings should be sortable.
For instance:
Root
- Section 1
- - Item A
- - Item B
- Item C
- Section 2
- - Item D
- - Section 3
- - - Item
2012 Jan 29
0
ActiveAdmin: Nested attributes not working for STI
HI All,
I am having Model "Customer" using STI for sender and receiver, and i am
unable to save the both sender and receiver by nested attribute. Below are
my model and active admin resource codes, correct me if i am wrong nested
attribute on concept.
CUSTOMER MODEL:
class Customer < ActiveRecord::Base
belongs_to :sender, :class_name => "Customer"
has_many