search for: game_ids

Displaying 13 results from an estimated 13 matches for "game_ids".

Did you mean: game_id
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]"> ....
2008 Apr 07
5
Associations errors
...nd_by_title(params[:school_id].gsub(''-'', " ")) for team in @school.teams ........ end @school does exist cause i tried with .find(:first) and it gave the same error. Also I''m getting undefined method `reject'' for #<Game:0x24ca1c4> From @home.game_ids = @game @game = Game.new(params[:game]) @game.opponent = params[:team][:name] @home = Team.find_by_user_id(current_user.id) @opponent = Team.find_by_name(@game.opponent) if @game.save flash[:notice] = ''Game was successfully created.'' @home....
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
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:
2006 Apr 07
5
Confusion about has_many / belongs_to ...
I have a table called players and its model Player, and I have a table called games and its model Game. In the games table I have: player1_id int(11) player2_id int(11) I want the tables to be associated so that I can access the player objects using table.player1 and table.player2 rather than having to lookup the objects based on the ids. I am not sure how to go about this but I suspect I
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 Jan 01
0
Join table with attributes
Hi folks, I''m trying to migrate a less-than-ideal schema for a Rails app that helps role-playing gamers (the pencil-and-paper type) connect with each other, at http://findplay.anvilwerks.com (the source is available there too, for the curious). The schema currently uses columns for played_games, wanted_games, and favorite_games in the players table; each of these holds a foreign key to
2010 Dec 01
0
Thinking sphinx + rails 3 issue in results set
Hi All, I am using rails 3.0 and i installed sphinx and added the following to gemfile gem ''thinking-sphinx'', ''2.0.0'', :require => ''thinking_sphinx'' My structure is like below: ========================== Model: ===== class User < ActiveRecord::Base include ActionView::Helpers::UrlHelper has_one :profile, :class_name =>
2012 Jul 17
0
Email Exception
Dear All, I would like to know How to Mailer Exception Handling. In My Project, I send email to all contact and view messages. Whatever emails is wrong, not send email, I wanna keep on process. UserMailer.message_email(@to_user,subject,message).deliver player = Player.new() player.user_id = current_user.id player.game_id = @game.id player.ishost = true I wanna do
2010 Jul 22
9
Something went wrong.
My app works fine in development on my laptop but in production on my server I get "We''re sorry, but something went wrong. We''ve been notified about this issue and we''ll take a look at it shortly." I am using Rails 3, Ruby 1.8.7, Apache and passenger 2.2.15 I get the welcome aboard page in production if I just go to the domain name but as soon as I want data
2008 May 08
6
[Bug 15864] New: when linked to gst-ffmpeg crash ff3 when full screen play
http://bugs.freedesktop.org/show_bug.cgi?id=15864 Summary: when linked to gst-ffmpeg crash ff3 when full screen play Product: swfdec Version: 0.7.x Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: plugin AssignedTo: swfdec
2007 Dec 10
15
Scaffolding for pre-existing database table in 2.0.1
Hi, first of all I will apologize in advance for my presumably noobish question, but I''m only starting to learn Rails and am a little confused with all the changes in 2.0.1. There are as good as no tutorials out yet and the 2 or 3 screencasts I''ve seen deal with the creation of both the app and the database. Now my problem is that I already have a database with a fair amount of