similar to: Model with 2 foreign keys

Displaying 20 results from an estimated 800 matches similar to: "Model with 2 foreign keys"

2005 Dec 19
4
need some help designing my messaging system
I am trying to create a messaging system for my users but I''m having a hard time designing my db. This is what i have in mind, but I am not sure if its the best approach. user has_one inbox user has_one outbox inbox has_many messages outbox has_many messages inbox table user_id outbox table user_id messages table box_id (refers to either inbox or outbox - how?) from_id to_id
2011 Jun 23
2
RSpec book help; why won't this stub method work?
Subscription model-------------------------------------------- class Subscription < ActiveRecord::Base has_one :user def can_send_message? if user.sent_messages.count < limit true else false end end end Subscription model spec-------------------------------------------- require ''spec_helper'' describe Subscription do describe
2007 Jun 23
2
End of File Error on index optmize
I was optimizing a 650MB using ferret (0.11.3) and I received the following error. I''ve seen some people have similar issues but I haven''t seen any resolutions. The contents of the index directory follow the error. Has anyone seen anything like this and found a resolution? Many thanks. /mnt/apps/search/releases/20070622175637/script/../config/../vendor/
2006 Jan 27
6
Switchtower deploy error
I''m trying to deploy a rails app with no success. I can execute: ''rake remote_exec ACTION=setup'' but when I try to execute : ''rake deploy'' I got this error: loading configuration c:/ruby/lib/ruby/gems/1.8/gems/switchtower-0.10.0 /lib/switchtower/recipes/standard.rb loading configuration ./config/deploy.rb executing task deploy transaction: start
2006 Jan 28
1
Switchtower different svn repo urls from my local box and my shared hosting
I got problems running switchtower 0.10.0 when I try to run "rake deploy" from my local box (windows) to my shared hosting If I set the repository to (deploy.rb): set :repository, "file:///home/[my_user]/repo/[my_app]/trunk" My local box (windows) can''t reach the subversion repository located in site5 If I set the repository to: set :repository,
2007 Dec 04
7
REST bug with form_for
Hi all, I am running on Windows XP sp2 with ruby 1.8.6, and rails 1.2.3 I am using REST, and have this in my view <% form_for(:project, :url => project_path(:user_id => @project.my_user, :id => @project), :html => {:method => :put}) do |f| %> The browser correctly gives <form method="post" action="/users/2/projects/1">
2010 Mar 11
1
Emails Disappearing -- Mystery
I got a case that I haven't been able to resolve. I hope somebody can give me some hints. One of our users is reporting emails disappearing in front of his eyes, (Right ... emails filters at the client side ....) Server does not have global sieve filter enabled (no file present), even though this configuration is present: sieve_global_path=/vmail/globalsieverc User does not have
2006 Aug 10
4
Speeding up ActiveRecord creation?
My completely empty model (no validation callbacks etc etc) takes an average of 0.05 seconds to create, at least according to Benchmark.realtime{200.times{Message.create(:from => "me@here.com", :message_type => ''email'', :subject => "hello", :body => "goodbye", :sent_at => Time.now)}}/200 That''s a little slower than
2006 Jan 28
1
Advice on Optimization, and where to put what?
In my last post I was asking how I could check for the existance of a record before inserting a new one and this was the helper method that I was using to do this: def already_friend_of?(friend) begin self.friends.find(friend.id) true rescue false end end I was told that this is not very efficient, as it hits the db every time I call it. I completely agree and would like to
2008 Mar 19
2
rsync fails to exclude... sometimes?
Hello List. I am using rsync to pull html files from a shared drive to 2 web server boxes to keep the files synchronized. However, I have a few files I do not want rsync to copy over because they contain information specific (IP address) to the box hosting them. Rsync seems to intermittently ignore the exclude statement and copies them from time to time. Is there a way to absolutely prevent
2010 Nov 30
4
Cucumber+Capybara rails 3 issue (Don't know where exactly)
When I''m executing cucumber tests, I noticed that sometimes rails app (in test env.) getting several the same requests (GET or POST) usually around 3, and it doesn''t render anything with empty HTTP status code. Have anyone met something similar to that issue? here is some example of log file: Started POST "/account" for 127.0.0.1 at 2010-11-30 22:34:17 +0200
2011 Aug 15
9
[PATCH 0/8] Staging: hv: vmbus: Driver cleanup
Further cleanup of the vmbus driver: 1) Cleanup the interrupt handler by inlining some code. 2) Ensure message handling is performed on the same CPU that takes the vmbus interrupt. 3) Check for events before messages (from the host). 4) Disable auto eoi for the vmbus interrupt since Linux will eoi the interrupt anyway. 5) Some general cleanup. Regards, K. Y
2011 Aug 15
9
[PATCH 0/8] Staging: hv: vmbus: Driver cleanup
Further cleanup of the vmbus driver: 1) Cleanup the interrupt handler by inlining some code. 2) Ensure message handling is performed on the same CPU that takes the vmbus interrupt. 3) Check for events before messages (from the host). 4) Disable auto eoi for the vmbus interrupt since Linux will eoi the interrupt anyway. 5) Some general cleanup. Regards, K. Y
2007 Mar 06
3
GTalk/Jabber passing audio in 1.4.1!
I've just compiled Asterisk 1.4.1 and I'm happy to report that I've got two-way audio between Google Talk and Asterisk! This IS an exciting moment today in VoIP! This is just GREAT! - Ronald Lewis http://ronaldlewis.com -------------- next part -------------- An HTML attachment was scrubbed... URL:
2015 Aug 25
6
echo password into bash script
Hey guys, I'm trying to echo my password into some commands inside of a bash script. But I think I'm going about it incorrectly. Here's the top part of my script: #!/bin/bash pub="~/.ssh/id_rsa.pub" dps_pass="my_pass" ssh="/usr/bin/ssh" scp="/usr/bin/scp" for i in 10.10.10.2{5,6} do echo "xfring key up" echo $dps_pass | $scp $PUB
2013 Feb 03
1
dsync backup questions
Hi, I'm currently trying to setup remote backups of my emails but i'm running into issues (mdbox format, indexes and storage in the same folder hierarchy). Local backup command: dsync -u "my_user" backup /backups/my_user (1) Recently, I noticed that the local backup takes up twice the size as the original mail location (8gb vs. 4gb). I purged alot of emails from the original
2005 Aug 09
6
Failed authentication to a mysql database (bug or PEBKAC?)
Hello, I'm trying to setup a mailserver running postfix and dovecot with mysql as database backend. Postfix is already running and delivers mails just fine. Unfortunately, dovecot has great problems connecting to the database (using username + password). If I disable the password, everthing works fine. But, thats harakiri, security wise ;-) I tried dovecot-1.0-stable and the latest
2014 Apr 23
2
Ulimit problem - CentOS 5.10
Running across some curious stuff with ulimit on CentOS 5.10. We have a non CentOS packaged version of Asterisk (using their packages) that we start at boot time with a typical RC script. Recently it started whining that it couldn't open enough file handles. As we dug further into this, it appears that at boot time, it inherits ulimit from init, which is pretty low: 1024. We've set
2004 Feb 04
2
Problem browsing my unix-client - session setup failed: NT_STATUS _CANT_ACCESS_DOMAIN_INFO
I installed samba 3.0015. I have a problem when I try to browse my machine from a windows client. In effect I am not able to "open" my unix-client. I checked nmbd and smbd and they are running. If I try from my unix-clinet: smbclient -L my_user -W my_domain -L my_PDC I can see shares. If I try from my unix client: smbclient -L my_user -W my_domain -L my_unix_client I get session setup
2010 Jun 01
3
lapply with functions with changing parameters
Dear all, I am trying to avoid a for loop here and wonder if the following is possible: I have a data.frame with 6 columns and i want to get a cross-correlogram (by using ccf) . Obivously ccf only accepts two columns at once and then returms a list. In fact, with a for loop i?d do the following for (i in 1:6) { x[[i]]=ccf(mydf[,i],mydf[,6]) } Is there any chance to the same with