similar to: Confusion about has_many / belongs_to ...

Displaying 20 results from an estimated 1200 matches similar to: "Confusion about has_many / belongs_to ..."

2010 Apr 27
2
How to work out 3-way probabilities
Hello. I have a quick question. I try to use logit regression, to work out probabilities in the sport event. I have work out probabilities for group of 2 players: p1 - probability, what player1 will beat player2 p2 - probability, what player2 will beat player1 pt - tie probability, p1 <- 1 - p1 - p2; Now i want to work out probabilities for group of 3 players, like: pg1 - probability, what
2006 Feb 19
4
Multiple HABTM to one table
I have a class Player, and a class Game. Game has two HABTM relationships to the Player table through seperate relationship tables. class Game < ActiveRecord::Base has_and_belongs_to_many :players, :uniq => true has_and_belongs_to_many :victors, :class_name => ''Player'', :uniq => true end When I add Player A to players, and Player B to victors, and save the
2005 Dec 14
5
inserting multiple rows
I have table which stores multiple entries. Each row has user_id, game_id and a pick_id. On a page the user has to make load of choices. All this gets submitted. the html looks like so: <input type="hidden" name="game_id" value="3"> <input type="hidden" name="user_id" value="19"> <select name="pick[3]"> ....
2006 Apr 25
3
ZFS quotas & zoned datasets
I''m seeing some unexpected and strange behaviour with respect to quotas and zones. Initially I set things up with no quota on the data set that as delegated to the zone. Then as the local zone admin I created a new child dataset and set a quota on that. Now the global zone admin attempts to quota the delegated dataset, and it appears to work but.... global zone=pingpong local
2008 Apr 07
7
Saving attribute
Something is getting lost here. def create @home = Team.find_by_user_id(current_user.id) for player in @home.players player.update_attribute(:game_id, @game.id) end end def show @players = Player.find_all_by_game_id(params[:id]) end view <%= @players.size %> # mistakenly equals zero Played with the console and everything should be working fine...
2007 Oct 08
6
spec''in controllers request for nested routes
describe PlayersController, "handling GET /saltmines/games/1/players" do before do @game = mock_model(Game, :to_param => "1") @game.stub_association!(:players, :find => mock_model(Player)) end def do_get get :index, :game_id => @game end it "should be successful" do do_get response.should be_success end it "should
2007 Sep 26
1
Youtube broken by 89d295a94
Hello! The current swfdec from git won't play videos on youtube. I had bisected the change. 8fc53e76 ("merge the too get_variable functions") is the last good revision. 89d295a94 ("implement swfdec_action_get_movie_by_path() and use it for GetVariable") is broken. Broken revisions show "share" and "watch" on blinking white background with two labels
2013 Apr 03
1
validates uniqueness scope allow_blank/allow_nil -> validation error
I have this in a model: class GenreBadge < ActiveRecord::Base belongs_to :game, counter_cache: :genre_badges_count, touch: true belongs_to :genre validates :game_id, uniqueness: {scope: :genre_id}, allow_blank: true end When I get one existing genre badge genre_badge = game.genre_badges.first genre_badge.game_id = nil genre_badge.save! It creates an validation exception:
2007 Feb 07
3
OTP?
Hello, I was wondering where I might find more information about using OTP as an authentication protocol with dovecot. In searching, I found a thread from 2004, but not much information about how it has progressed from then. I also saw some promising patches from mid-last year, which if I had to guess are probably the addition of support for the SASL OTP mechanism. Is this available in a
2006 Apr 14
11
Whats the best Ajax way to update a textarea''s text?
I am looking for a way to update the text-value within a textarea from an Ajax render call inside of a controller. Is there a way to do this without rendering an the partial containing the textarea? Thanks, Andy -- Posted via http://www.ruby-forum.com/.
2003 Nov 10
3
Asterisk and Polycom Soundpoint IP600
This Polycom phone seems to be one of the best on the market for sound quality and features. I have seen on the list that some people have gotten the IP 600 to work with Asterisk. Does anyone have the details of how to get this working i.e. XML phone config files, and any thing else I might need to know. Thank You, Chad Cowan -------------- next part -------------- An HTML attachment
2009 Jul 03
1
Dynamic libraries
I am trying to write a dynamic linked library for R, in Pascal. (This is to speed up the execution of a simulation that I am running in R.) I know Pascal might not be the perfect language for this (C or Fortran being more natural), but from what I have read I think it should work. Though I should point out that I am a neophyte when it comes to DLLs. From R I want to hand a function in
2008 Jan 28
9
Nested matchers
We''re encountering a failure with Mocha 0.5.6. We had this expectation: game_version.expects(:attributes=).with(:game_file => kind_of(GameFile), :game_id => @game.id) This expectation was passing with 0.5.5, but fails with 0.5.6. I added this test to parameter_matcher_acceptance_test.rb, which passes in 0.5.5 and fails in 0.5.6 def test_should_match_nested_parameters
2006 Apr 03
4
Layout Question w/ code from vendor library
I am new to Ruby on Rails in general and apologize if this question is trivial and/or has been asked before ( my searches did not turn up any threads ). I am using the cookies function from actionpack which I have located in my vendor/rails/actionpack directory. Using: cookies[:username] and cookies[:password] from within a controller file works just fine, I am able to set and read
2017 Sep 08
1
Antwort: Antwort: Re: Windows 10 and Java Applications on a samba share
Hai, Dit you set : acl allow execute always = yes Greetz, Louis > -----Oorspronkelijk bericht----- > Van: samba [mailto:samba-bounces at lists.samba.org] Namens Nils > Wieseloh via samba > Verzonden: vrijdag 8 september 2017 9:43 > Aan: nils.wieseloh at vit.de > CC: samba at lists.samba.org; Brian Cowan; samba > Onderwerp: [Samba] Antwort: Antwort: Re: Windows 10 and
2006 Nov 16
3
STATUS_INVALID_LOCK_SEQUENCE when writing to a file....
[Note to moderator, I couldn't remember which email account I subscribed to this list from. Sorry...] Hi All, Have any of you seen this little darling of an error on writing to a file? The sequence of events goes something like this: 1) File is opened for reading on a Samba server with oplocks disabled. Open request is requesting a batch oplock. 2) File open SUCCEEDS. (Should this have
2002 Mar 20
5
inverted axis
Hello everybody! Spse I have the following X <- seq(1:100) #(a dim(100) sequence of integers 1:100 representing the possible actions of player 1 and player2 in a game) BR2X<- br2(X) #(a dim(100) sequence of points on range (1,100) representing the best response function of player 2 to player 1:s actions) BR1X<- br1(X) #(a dim(100) sequence of points on range (1,100)
2012 Sep 11
1
CRAN, install packages problem on networked PC
Dear List, I have a problem connecting to a CRAN mirror through a networked computer running Vista Enterprise on a Dell PC. I added http_proxy=http://gannet/ http_proxy_user=ask to the Target in the R shortcut, completed the username and password in the Proxy Authentication window, but get the following warning: Warning message: In open.connection(con, "r") : unable to resolve
2006 Apr 24
9
Confusion with expressing many to many relationship
Hi folks, I am in the process of converting an existing non-rails application to rails, and am not sure what the best approach would be for specifying the relationship between the two sets of data. I''ll describe the existing table structures first. Table 1: Urls Each url has a unique id and two lists of Phrases, these are currently setup as varchars with "," delimitation -
2006 Mar 23
4
belongs_to more than one model
Suppose I have one table: states id statename And I have two other tables that contains states: houses id color state_id places id place_name state_id How would my model relationships look like? class State < ActiveRecord::Base belongs_to house belongs_to place end class House < ActiveRecord::Base has_one state end class Place <