similar to: Model relationship confusion ...

Displaying 20 results from an estimated 9000 matches similar to: "Model relationship confusion ..."

2007 Jul 24
4
spec''ing helpers that use controller
Hi all, I''m in the process of creating rspecs for my helpers. One of the helpers in app/helpers/application_helper.rb looks like this: def page_name @page_name || "Define @page_name in #{controller.controller_name}::#{controller.action_name}" end The rspec is simply: it "should something" do page_name end
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
Hi all, I feel like I''m missing something really easy and I''m just not seeing it. I''m using the restful_authentication plugin and have a User model. Uesr has_many :things and Thing belongs_to :user. That''s it. I did a "script/generate rspec_scaffold thing" to generate all the necessary bits. The "rake db:migrate" to create the db. At
2006 Jul 14
5
Acts_As_Taggable Plugin multiple controllers.
I have Acts_As_Taggable Plugin working. I have a HR controller and a sales controller. I have a document in hr tagged whitepaper and a differnent document in sales tagged whitepaper when I am in hr I see the hr document tagged with whitepaper and not the sale document (what I want). but if I click on the tag whitepaper I return two documents, hr and sales. I just want to return the hr document
2006 May 28
7
Self-referential has_many :through relationship
Hi, I have a self-referential has_many :through relationship setup to track relationships between users. Basically relationships are modeled as a join table with an extra column ''relation''. create table relationships ( user_id integer unsigned not null, friend_id integer unsigned not null, relation char(1) not null, ) --- relations --- f = friend r = request to
2006 Mar 10
5
case insensitive search
I am having trouble with a simple gallery search. I type in a segment of the address and i only seem to be getting results if I use the correct case. This is in my Gallery controller: def search @gallery = Gallery.find(:all, :include => :property, :conditions => "address LIKE ''%#{@params[:keywords]}%''") end On a different note: I am having
2016 Jul 11
3
Master-Master replication question
Quoting "William L. Thomson Jr." <wlt-ml at o-sinc.com>: > You are not alone! > > On Wednesday, July 06, 2016 01:15:34 PM Remko Lodder wrote: >> Dear list, >> >> I have setup a master-master replication setup. My primairy MX's send >> email >> over on a DNS loadbalanced way, so DNS is doing some kind of round-robin >> way of sending
2006 Aug 10
6
Login Restfully
In DHH''s keynote, he alluded to doing logins with REST. Has anyone implemented this, and if so, would you mind elaborating on how you did it please? Thanks in advance. -- Posted via http://www.ruby-forum.com/.
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and often do: rake load_fixtures... ... in order to populate my development database with fun data. Now, with any HABTM relationship, there are failures, as there is no way to say "which" fixtures to load first. Within an actual functional or unit test case, you could simply load them in the proper order, but
2020 Jul 05
1
[PATCH 5/5] virtio_console: Constify some static variables
On (Wed) 01 Jul 2020 [22:09:50], Rikard Falkeborn wrote: > The id_table and feature_table pointers in struct virtio_driver are > pointers to const. Mark the corresponding static variables const to > allow the compiler to put them in read-only memory. > > Before: > text data bss dec hex filename > 25447 713 76 26236 667c
2006 Jul 19
2
SimplyRestful bug?
Hi I have my routes set up like this: map.resource :contact, :path_prefix => "/employers/:employer_id" so now when I view all contacts for an employer I go to: /employers/1/contacts That works. On that page, there''s a problem with the routes: new_contact_url translates to: /employers/1/contacts/new ... so that works. But, contact_url(@contact) gives me
2006 Mar 14
3
Simple search on joined table
Looking for some guidance, I seem to be caught in the weeds. I want to do a search on fields in a master/detail relationship. E.g. manufacturer owns many parts. I want to search on the manufacturer name, part name and part number, then return the full set of results. I have tried to use the .find method and create my own model .find method using a SQL statement, but then the results do not
2006 Sep 23
8
svn problems
I can consistently segfault the 0.10.4 gem, so I''m trying to get the subversion version working with hopes towards tracking the problem down. I have a fresh SVN checkout but: a) the version (in ferret.rb) claims to be 0.9.6; and b) Ferret::Index::FieldInfos and a couple other classes are missing at run time. It looks like this is because they''re not exported in the C
2018 Jun 20
2
Bad message_id occasionally when connecting a MacOS to a freebsd running 4.8.2
Hi, I am running Samba 4.8.2 with fruit and use it to connect a MacOS to the server. Mostly it works very good, but occasionally the connection halts or the Mac disconnects, and in the log I find these messages: Jun 20 13:00:00 orca smbd[6033]: [2018/06/20 13:00:00.856101, 0] ../source3/smbd/smb2_server.c:641(smb2_validate_sequence_number) Jun 20 13:00:00 orca smbd[6033]:
2023 Jul 21
2
Bug 15346 - 2-3min delays at reconnect with smb2_validate_sequence_number: bad message_id 2 still on new 4.17.10
Hello to all, I can confirm, that the bug, smb2_validate_sequence_number: Jul 21 08:22:44 dom2 smbd[1908004]: smb2_validate_sequence_number: smb2_validate_sequence_number: bad message_id 2 (sequence id 2) (granted = 1, low = 1, range = 1) Jul 21 09:24:39 dom2 smbd[1908332]: [2023/07/21 09:24:39.140658, 0] ../../source3/smbd/smb2_server.c:677(smb2_validate_sequence_number) Jul 21 09:24:39 dom2
2006 Feb 17
2
Accessing just the body of email in text format?
I am interested in accessing the body of the email in text format using IMAP to receive emails. So far I have tried the following #body = imap.fetch(message_id, "BODY[TEXT]") #body = imap.fetch(message_id, ["BODY[]"])[0].attr[''BODY[]''] But both of the above give me body text + the headers including Content-Type etc. How can I access
2005 Aug 12
3
OT: Sendmail question
Hi, all I want voicemails to be delivered to recepients by e-mail. I have set up voicenail, and I can see asterisk is using sendmail to send messages out. Using Ethereal, I can see that messages are leaving my network, but receipeint mail server never replies back. As a result, mail delivery is timed out. I got a book on sendmail and it looks quite complex. It will take quite a bit of time
2006 Jul 09
3
Mongrel and proxying with Apache 2 mod_proxy
Hi all, I''ve just spent some time going through trying to get mongrel & apache 2.0 working with mod_proxy. I thought I''d share what I''ve found in case someone is going through the same exercise. Of late, I''ve been using mongrel (lovely, btw) to run my rails apps. Since I have a couple of different rails apps running on the machine, I thought it be nice to
2006 Mar 16
5
TimeZone, TZInfo, daylight savings, and composed_of
Does anyone know the best way to track time zone information. There doesn''t seem to be much documentation on this. So far it seems like a simple db field like create table accounts ( id int unsigned not null auto_increment, name varchar(50) not null, time_zone varchar(50) not null, ... primary key (id) ) and a class like class Account < AR ...
2006 Aug 05
2
yield :layout, add extra content at controller level
Hi, Could someone point me in the right direction for specifying content at the controller level so that I could use something similar to "yield :left_nav_content" as well as "yield :layout" in my layouts? I know I can specifiy this content in my view using something like: <% content_for("left_nav_content") do %> <h1>Some Menu Options</h1>
2006 Apr 06
1
Primary keys and migrations
I have a join table I''m creating with a migration as follows: create_table :read_global_messages, :id=>false do |t| t.column :user_id, :integer t.column :message_id, :integer end So far so good, however I want the primary key to be user_id and message_id. How do I do this? I tried the following, but that doesn''t work: add_index