Displaying 20 results from an estimated 10000 matches similar to: "Map a resource that is a join model"
2009 Feb 04
2
delete_if does not work on associations
I tried to user delete_if on an association:
class Group < ActiveRecord::Base
has_many :memberships, :dependent => :destroy
has_many :users, :through => :memberships
...
end
This is the controller method, trying to use delete_if. Although some
elements are removed (s2 < s1), the save method does not update the
association.
def intersect_or_remove_group
other_group =
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
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
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 Jun 19
2
const_missing error of has_many through association
Hi,
I am new to ruby on rails. I am building an association join model
and encountered the following error. Does anyone know what am I
missing?
> NameError in StartController#home
>
>d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in `const_missing'': uninitialized constant Membership
I have the following tables relationships
Users
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
2007 Apr 29
1
better nested set and :through
Hello all,
It''s been a while since i''ve been doing any rails development, so i''m a
bit rusty. Having found this:
http://opensource.symetrie.com/api/better_nested_set/
it looks really interesting and useful for solving something i''m trying
to get working.
What i have (essentially) is the following models:
class Group < ActiveRecord::Base
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
2006 Aug 03
6
Listing all of a nested Resources
I''ll use the example on the Rails blog.
map.resources :posts do |posts|
posts.resources :comments, :trackbacks
end
Now comments are at /posts/:post_id/comments.
Okay but what if I want to list all the comments for all the posts. It
should be at /comments, but that isn''t map that way. Can I map comments
twice?
--
Posted via http://www.ruby-forum.com/.
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
2005 Nov 22
11
Building a conditions clause (for find) of multiple optional params?
I want to be able to find items according to various params - category_id, member_id, type_id,
rating, etc. What I have now is something like:
if(@params[''category_id''])
@items=Item.find(:all, :conditions=>["category_id=?", @params[''category_id''])
elsif(@params[''category_id''] and @params[''member_id''])
2008 Sep 17
13
Capturing the sql from a statement without executing it?
Hi guys,
Is there an elegant way to capture the sql that would have been
executed by an ActiveRecord statement, without actually executing
it? :)
I''m imagining something like
sql = User.find(1).groups.to_sql
or perhaps
sql = ActiveRecord::Base.capture_sql { User.find(1).groups }
resulting in sql = ''SELECT * FROM groups INNER JOIN memberships....
WHERE users.id =
2013 Feb 05
1
Samba4 4.0.3 classicupgrade - Error converting string to value for line: "CurrentVersion"
Hello everyone,
I'm trying to migrate from samba3 to samba4 (4.0.3 installed from source in
a debian squeeze 6.0.6)
And I'm getting this error:
Setting up the registry
convert_string_talloc: Conversion not supported.
Error converting string to value for line:
"CurrentVersion"
I found this thread in internet about this
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
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
2015 Apr 26
2
Migration to Samba 4
Testing this "classic upgrade" scenario on a test server and have some
issues. I'm using the Sernet 4.2.1 packages on Debian Wheezy.
I copied the required tdb files and the smb.conf to the new test
server (named WHEEZY). Edited the smb.conf to reflect the new
host/netbios name of WHEEZY (remember that I want to keep the old PDC
in service afterword for file and print sharing duties
2008 Dec 26
2
about randomForest
hello,
I want to use randomForest to classify a matrix which is 331030?42,the last column is class signal.I use ?
Memebers.rf<-randomForest(class~.,data=Memebers,proximity=TRUE,mtry=6,ntree=200) which told me" the error is matrix(0,n,n) set too elements"
then I use:
Memebers.rf<-randomForest(class~.,data=Memebers,importance=TRUE,proximity=TRUE) which told me"the error is
2020 Sep 16
5
Adding user to group doesn't propagate?
On Mon, 31 Aug 2020, Jonathon Reinhart via samba wrote:
> On Mon, Aug 31, 2020 at 9:21 AM Harald Hannelius via samba
> <samba at lists.samba.org> wrote:
>> On Wed, 17 Jun 2020, Harald Hannelius wrote:
>>> On Wed, 17 Jun 2020, Harald Hannelius via samba wrote:
>>>> On Wed, 17 Jun 2020, Rowland penny via samba wrote:
>>>>> On 17/06/2020 11:54,
2020 Sep 17
2
Adding user to group doesn't propagate?
On Wed, 16 Sep 2020, Rowland penny via samba wrote:
> On 16/09/2020 09:02, Harald Hannelius via samba wrote:
>> On Mon, 31 Aug 2020, Jonathon Reinhart via samba wrote:
>>> On Mon, Aug 31, 2020 at 9:21 AM Harald Hannelius via samba
>>> <samba at lists.samba.org> wrote:
>>>> On Wed, 17 Jun 2020, Harald Hannelius wrote:
>>>>> On Wed, 17 Jun