similar to: belongs_to not working as

Displaying 20 results from an estimated 1000 matches similar to: "belongs_to not working as"

2006 Jun 27
3
belongs_to <parent name>, :foreign_key modifier not working
All, I have two ActiveRecord objects. TargetList has_many Targets Targets belongs_to TargetList I''ve specified belongs_to :target_list, :foreign_key => ''DataSetID'' Queries generated by various methods in target_list do not seem to see the foreign_key name and keep trying to query my Target table using "target_list_id" (the default foreign
2006 Jun 29
4
Multiple belongs_to
Let''s say I have a catalog with hotels. Each hotel belongs to a category (4-star, 5-star etc.) This is it''s official category.However, there is also a category that users assign and a category that "independent reviewers" assign. So I have this: hotels { id, category_id, reviewer_category, user_category } categories { id, name } class Hotel <
2005 Dec 14
5
belongs_to and multiple foreign keys
Hi all, I''m confused about how I''m supposed to specify a belongs_to relationship when the table includes multiple columns that reference the same parent table. In my case I have a "schedules" table with "opened_by" and "closed_by" columns, that both reference the "users" table. In theory, they can be two different user ids. table
2006 Feb 27
4
2 belongs_to to the same parent table
Hello! I have 2 table: users and buddies User: id, name, ... Buddy: id, user_id, user_buddy_id, ... So if you have 2 users 1,jack and 2,fred and fred is a buddy of jack, there is a Buddy object: id=1, user_id=1, user_buddy_id=2 I can declare only one belongs_to in Buddy and one has_many in User. And there is conflict if I had the second one (the first one is discarded) class User has_many
2006 Apr 25
3
belongs_to and has_many
I know this has been rehashed many times, but I don''t get it. I can''t find it documented to were I understand all the parts. I can make this work using Rails database design conventions, but in this case I am not able to do that. I find examples, but the ones I find do not follow the conventions. They also do not give enough information to understand what is going on. In
2006 Apr 03
2
Problems with STI in has_many/belongs_to in Rails 1.1
I have a problem that surfaced in my attempt to upgrade my application to Rails 1.1. We have a STI model on the "belongs_to" side of a has_many/belongs_to relationship. All my unit tests for this model pass, and the relationships all seem to work fine. But in my functional tests, I''m getting errors. I''ve traced it back into the call to the has_many
2007 Aug 23
6
Calling a method on class creation
I have a model User that has property called status. Status is just a string that can only be evaluated and not persisted. I.e. it doesn''t have a field in the user table. Anyways, I would like a method get_status to be called anytime I create a new instance of User. For example: user=User.new Since I created a new instance of User, I should now have access to the status property, e.g.:
2006 May 25
11
belongs_to confusion and some other questions - thanks!
Hello all, Thanks for the help in advance, I am having some trouble with belongs_to, and I caint seem to figure it out. I have two tables, one called ''pow_users'' and one is called ''pow_site'' pow_users has a field called site that has the site ID for primary id in the pow_site'' table. the pow_site table setup as the Site class with the following:
2008 Mar 15
1
error on belongs_to method.
I followed the Ruby on Rails up and running book published by Orielly. there are three DB tables, photo, slideshow, and slide the Slide class in slide.rb is like this: class Slide < ActiveRecord::Base belongs_to :photo :foreign_key =>photo_id belongs_to :slideshow :foreign_key=>slideshow_id end I inserted the sample data into database. When I trying to run the command on page39:
2007 Sep 03
7
relationing has_many, belongs_to
Hello, i want to know if i am relationing fine, because i am having problems,i have 2 models, one for members and other to relate some members to this: class Member < ActiveRecord::Base has_many :matrix, :foreign_key=>:parent end class Matrix < ActiveRecord::Base set_table_name :matrix set_primary_key :userid belongs_to :member, :foreign_key=>:userid acts_as_tree
2009 Dec 26
3
Does :class_name for belongs_to have to be a string and why?
Seemingly, when I use a symbol, I get an ActiveRecord error stating ''Can''t convert symbol into String.'' Why can''t I use a symbol here? Possibly this is a deeper misunderstanding of symbols in general on my part. #ActiveRecord error class Book < ActiveRecord::Base belongs_to :author, :class_name => :Person, :foreign_key => :author_id end #works
2008 Feb 22
4
has_many and belongs_to in rails 2.0.2 (child.Parent) is not working
Hi All I have 2 models working well in rails 1.2.6 : class TypeService < ActiveRecord::Base has_many :Services end class Service < ActiveRecord::Base belongs_to :TypeService end I was able to get the name of the service with Rails 1.2.3: s = Service.find(1) name_type_service = s.TypeService.name <<-- Now with rails 2.0.2 that doesn''t work With rails 2.0.2 s
2015 Oct 20
2
help filtering messages
Hello, I'm attempting to use sieve-filter on a local mailbox. I've defined mail_location as follows: % grep mail_location /etc/dovecot/conf.d/10-mail.conf mail_location = maildir:~/Mail I have a large number of mailboxes / mail in ~/Mail: ~ % find Mail | wc -l 63158 There are definitely a few messages in INBOX: ~ % find Mail/INBOX/cur | wc -l 5 I must admit, I'm completely new
2008 Apr 18
3
has_many and belongs_to with non-primary foreign keys
Hi, I''m having a bit of trouble with my first Rails app. ---- I have two tables: create_table :items do |t| t.column :created_at, :timestamp t.column :user_id, :int t.column :text, :text end create_table :users do |t| t.column :user_id, :int t.column :name, :string end ---- I''m trying to use the "user_id" field to link both tables, with each user
2011 Jun 27
1
Sendmail + dovecot-lda + LDAP
Hi, I experince some problems with setting up Sendmail with the LDAP database for virtual mail accounts. Why i'm not writing to the LDAP mailing list? I believe, that the reason of my problem is in configuring dovecot-deliver. What i have: ?- FreeBSD ?- sendmail (Version 8.14.4 with LDAP support installed from ports)? ?- Dovecot LDA + dovecot (as pop3/imap) ?- Cyrus Sasl (authdaemon for
2006 Dec 07
2
Problem saving parent and children using belongs_to, class_name, and foreign_key
Hi, I have a real simple association setup here that''s just trying to: - Create a new PayjunctionOrder - Create some LineItem objects and assign them to the PayjunctionOrder - Save everything I''m using Rails Edge. ---- class PayjunctionOrder < ActiveRecord::Base has_many :line_items end ------------------ ---- class LineItem < ActiveRecord::Base belongs_to :order,
2003 Dec 04
3
SAMBA Groups and Permissions
hi i have a user ~# id test_user uid=500,gid=500 (users),groups (users,kids) as you can see, this user is in primary group "users" and also member of group "kids" if he tries to access /home/board via smb (Samba 3.0 + openldap) from a windows client (XP), he fails, because his sambaPrimaryGroupSID maps to -> "users" and /home/board is not accessible for
2008 Jul 16
2
belongs_to causing endless loop on first call to save!
Hi, I have a situation I''m hoping someone out there may be able to shed some light on. I have a Rails app (2.1.0 on Ruby 1.8.7) with a wizard-based sign up process, that has recently been changed from storing incremental data in the database to having a medium sized object graph living in the user session until the user completes the entire sign up process (this is a business
2003 Dec 04
1
Réf. : Re: SAMBA Groups and Permissions
I confirm that Malte M?ller says. If you want to set multiple group acces, you must use ACL. the valid user parameter in smb.conf force the right of directory but the unix right is only for group user. ----------------------------------- St?phane PURNELLE stephane.purnelle@corman.be Service Informatique Corman S.A. Tel : 00 32 087/342467
2019 Jun 11
2
Sharing directory via Samba using AD credentials
Hi List, I?m attempting to configure an Active Directory joined CentOS 7 host to share directories with Windows clients using Samba. The machine has been joined to the domain via: ?adcli join --stdin-password --domain-ou=?OU=Servers,DC=domain,DC=com' --login-user={{ private_ad_username }} -S dc1 DOMAIN.COM". Logging in to the host via ssh with AD user credentials works fine. I have SSSD