Displaying 20 results from an estimated 10000 matches similar to: "Bypassing automatic STI generation"
2006 Jun 30
2
how to HABTM with STI ??
Hello all
This is my first post so excuse the basic question. (and any repeats I just
got an email saying this post was too big so I have re-submitted a smaller
version)
I was following the thread on
http://lists.rubyonrails.org/pipermail/rails/2006-May/038988.html regarding
the STI on HABTM for RoR.
I have a very similar problem and was hoping for some help.
I have 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 Dec 31
2
Presenting a grouped list of objects from STI
Hello,
I have been following the STI example in AWDWR and have a question about
presenting the output.
I want to output a list of Person objects that are grouped by their
type.
I have an array of all the Person objects and I would like the output to
be as follows.
Employee x3
<ul>
<li>Employee 1</li>
<li>Employee 2</li>
<li>Employee 3</li>
</ul>
2006 Dec 28
2
STI, controllers and views
Hello,
I have set up that uses single table inheritance. I have a number of
model subclasses following the example in AWDWR that uses Manager <
Employee < Person.
First question. Do I need to create controller classes for each? I
don''t think I do because a single controller should be able to shunt the
data between the models and the views.
Second question. Say I have a view
2006 Apr 05
5
when is model() needed?
I have just some vague and thus probably wrong ideas about when to
use model() in controllers, and by now I err on being redundant. I
don''t post them here to avoid leaving anything that may be false in
the archives.
Can anyone explain exactly in which cases one should use model()?
-- fxn
2006 May 16
1
:conditions on has_one realationship
Hi there,
I''m currently building a membership application and I want to be able
to select, not just all the memberships, but the most current
membership from the database on a per user basis. I have linked the
tables as shown:-
class Membership < ActiveRecord::Base
belongs_to :payment
belongs_to :person
end
class Person < ActiveRecord::Base
has_many :memberships
2006 Jul 26
8
team captain - habtm w/has_one...
the below...
class User < ActiveRecord::Base
has_and_belongs_to_many :teams
class Team < ActiveRecord::Base
has_and_belongs_to_many :users
has_one :captain, :class_name => ''User''
produces the error...
Mysql::Error: Unknown column ''users.team_id'' in ''where clause'': SELECT *
FROM users WHERE (users.team_id = 1) LIMIT 1
i
2007 Nov 24
12
orphan habtm rows
HI,
i use models User and Groups connected with many to many association, so
i have users table, groups and groups_users.
lets say i create one user and one group. next i add a group to user. so
now my table groups_users has one entry i.e.
group_id | user_id
_________|________
1 | 1
ok, when i delete both my group and user, above entry is not deleted,
thus leaving alone without
2011 Dec 05
2
How to bypass a create record after validation wo error ?
I have a specific signup process to handle, and I am turning around
the solution wo finding a clear validation ...
a visitor fill in a User Registration form ( email /pwd /pwd
confirmation )
I wrote a UserValidator class to check the uniqueness of the email
field
# if no user registered w this email, then no error , can proceed to
create
User.where(:email => self.email).empty? # no
2006 Aug 03
4
Map a resource that is a join model
How should you map resources that are join models like Memberships?
Lets say have you have Members and Groups that are joined through
Memberships.
map.resources :members do |members|
members.resources :groups do |groups|
groups.resources :memberships
end
end
This doesn''t seem right.
It would be nice to access all members, groups, and memberships at
/members,
2018 Jan 31
3
netsamlogon_cache.tdb & winbind.
All,
I wonder if someone can give me an idea what the file "netsamlogon_cache.tdb" contains... as I have noticed that I can be added to a group, and access will not appear on the Unix side for a good deal of time... but if I stop Winbind, remove the file "netsamlogon_cache.tdb", and re-start everything, it will then work.
Can anyone tell me what the purpose of this file is,
2023 Feb 15
2
2023 X.Org Foundation Membership deadline for voting in the election
The 2023 X.Org Foundation elections are rapidly approaching. We will be
forwarding the election schedule and nominating process to the
membership shortly.
Please note that only current members can vote in the upcoming election,
and that the deadline for new memberships or renewals to vote in the
upcoming election is 26 March 2023 at 23:59 UTC.
If you are interested in joining the X.Org
2019 Nov 01
2
Individuals interested in VESA memberships?
Hi! Recently I've been working with the rest of the X.Org board to try to get
X.org access to VESA memberships so that contributors that don't have an
employer who is able/willing to join VESA can potentially get access to the
various benefits of a VESA membership, such as access to DisplayPort
specifications. Since I need to gather a list of interested X.org members, I'd
like to know
2008 Sep 16
3
has_one :through eager-loading problem
I have a problem with the :include option in find for my
has_one :through association.
I have Users, Profiles and Customers, all connected to each other with
a has_one :through => :membership association like this:
class Profile < ActiveRecord::Base #could also be user or customer
has_one :membership # i saw an acrticle of Ryan about
has_one :through, there this would be has_many, is
2017 Jun 30
2
User management scripts in AD mode...
Mandi! Rowland Penny via samba
In chel di` si favelave...
> > I'm again a bit confused... ;-(((
> Yes I can see that ;-)
;-)
Sorry for the late answer, but i was busy on other things...
> Hope this helps, but feel free to ask any questions.
I try to summarize:
a) as i supposed 'RFC2307 group membership' are totally ignored by
samba, so i can use RFC2307 schema to
2008 Apr 21
1
Urgent ActiveRecord has_many Problem - Please Help
Hi Guys,
I''ve been looking everywhere for an answer to this but so far without
success.
I have three models:
1) employees
has_many :memberships
has_many :projects, :through => :membership
2) projects
has_many :memberships
has_many :employees, :through => :membership
3) membership
belongs_to :employees
belongs_to :projects
Membership is used to join employees
2009 Mar 22
5
How does view know about instance vars set in controller?
Hi,
I know that the AWDWR says to believe in magic and to not spend Xmas
with people asking this question, but really how does it work under the
hood?
I was looking at the source code of crummy, and it seems that
instance_variable_set and instance_variable_get may be part of the
answer. Is there some resource on that or do I have to dive into Rails
code?
--
Posted via
2005 May 30
2
"FANNY" function in R package "cluster"
Dear All,
I am attempting to use the FANNY fuzzy clustering function in R
(Kaufman & Rousseeuw, 1990), found in the "cluster" package. I have
run into a variety of difficulties; the two most crucial difficulties
are enumerated below.
1. Where is the 'm' parameter in FANNY?
In _Finding Groups in Data: An Introduction to Cluster Analysis_
(1990) by Kaufman & Rousseeuw,
2018 Jun 01
3
winbind, nsswitch, AD and group membership caching?
Folks;
using samba+winbindd+pam+nsswitch to make several Linux servers
authenticate against an AD domain, I do have my setup mostly working
now:
- AD users are able to ssh into the machine.
- wbinfo -g / -u does list all domain users.
- getent group / getent passwd does list Unix and AD users.
However, after changing some users group memberships in AD, I didn't
manage to propagate this
2006 Jan 19
2
has_many :through
Has anyone had much experience using the new has_many :though options
that are currently in Edge Rails? I''m looking at using it in my
project but haven''t found much about it.
Kyle