Displaying 13 results from an estimated 13 matches for "game_id".
Did you mean:
name_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=&q...
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...
--~--~---------~--~----~------------~-------~--~----~
You received this message becau...
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 render index template" do
do_get
response.should render_template(''index'')
end
end
1)
ActiveRecord::RecordNotFound in ''PlayersCon...
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:
"ActiveRecord::RecordInvalid: Validation failed: Game has already been
taken"...
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
test_result = run_test do
mock = mock()
mock.expects(:metho...
2006 Jan 01
0
Join table with attributes
...played," or "favorite."
However in searching online I find that, according to the rails wiki, join
tables with attributes are problematic. I can use push_attributes to get
that status attribute, but a delete operation would apparently kill all
entries that match on the player_id and game_id columns, ignoring
differences in status. Is this still an issue? Or has it been fixed in Rails
1.0? Is the usage different from what''s suggested on the wiki? (I can''t seem
to find this link again, or I''d include it--my apologies.)
--JB
-------------- next part ----------...
2010 Dec 01
0
Thinking sphinx + rails 3 issue in results set
...t; ActiveRecord::Base
include ActionView::Helpers::UrlHelper
has_one :profile, :class_name => "UserProfile", :dependent => :destroy
has_many :game_attributes, :dependent => :destroy do
def game(user, gme,dt)
find(:all, :conditions => {:user_id => user.id, :game_id =>
gme.id, :date => dt})
end
end
has_and_belongs_to_many :interested_game,
:class_name => ''Game'',
:join_table => ''interested_game_users'',
:order => ''name''
define_index do
indexes login
in...
2012 Jul 17
0
Email Exception
...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 player process.
How I catch exception for like this.
Regards,
Phoesan
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this...
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