search for: team

Displaying 20 results from an estimated 25082 matches for "team".

2011 Jan 06
2
Help with IF operator
Hi, I am with a problem on how to do a comparison of values. My script is as follows: repeat{ cat("How many teams to use? (to end write 0) ") nro<-scan(n=1) if(nro==0)break cat("write the", nro, "teams names \n") teams<-readLines(n=nro) if (teams[1]==teams[2)next else print(teams) } On this example I only compare teams 1 name with teams 2 name, and if they are the same the scr...
2006 Aug 16
6
Create several models at once and validating
I have two models User and Team. Also I have a register form where the new user fill in her data and choose a name for a Team. Well, in the user model there are several validations which work fine, but team model also have a validation for a uniqueness name that doesn''t fire up when she gives an existent team'...
2008 Jan 27
4
(REST) Nested routes
Hello, I''m in troubles with nested routes. I have three models: Team, Tournament and TeamTournaments class Team < ActiveRecord::Base has_many :tournaments, :through => :team_tournaments has_many :team_tournaments class TeamTournament < ActiveRecord::Base belongs_to :team, :foreign_key => ''team_id'' belongs_to :tournament, :clas...
2006 Jul 26
8
team captain - habtm w/has_one...
the below... class User < ActiveRecord::Base has_and_belongs_to_many :teams class Team < ActiveRecord::Base has_and_belongs_to_many :users has_one :captain, :class_name => ''User'' produces the error... Mysql::Error: Unknown column ''users.team_id'' in ''where clause'': SELECT * FROM users WHERE (users.team_id...
2008 Apr 07
5
Associations errors
undefined method `each'' for 0:Fixnum at line @school = School.find_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[:tea...
2006 Jan 23
15
Looking for DB/Model Design Suggestions
Hi, I''m working on an app - my first Rails - and am looking for some suggestions on the best way (or good way) to set up my models / DB. In general there are teams and matches; a team will participate in multiple matches, and in each match there will be 6 teams - 3 vs. 3. I''m going to want to be able, for a particular team, pull up all matches for that team, to display a scoring summary, etc. I was thinking of two tables Team and Match. The team...
2007 Oct 16
8
Using multiple foreign keys in views
I have a model, Game, that has_many :teams. There''s a home team and an away team. I created two foreign keys, so each game can have two teams associated with it. Here''s the Team model: class Team < ActiveRecord::Base belongs_to :game, :class_name => ''Game'', :foreign_key => ''homet...
2007 Feb 20
1
Urls generated by nested map.resources
...ew RESTful routes. For resources that aren''t related to anything else, everything makes sense - for resources with relationships, I am less certain of what the "right" thing to do - especially in relation to the urls produced, and how to modify those urls. For example, if I have teams and roles - each role belonging to one team and teams having many roles. Each role *must* belong to a team. Currently my routes.rb looks something like this: map.resources :team do |team| team.resources :roles end map.resources :roles The urls I *think* I want for roles are: GET /roles...
2021 Jul 13
3
Microsoft Teams on CentOS 7. Does the latest version work?
Does anyone else run Microsoft Teams on CentOS 7? I've used it for a while now, and it's generally worked reasonably well. However, after upgrading to the latest version from the Microsoft repos, it doesn't start up properly. Processes start and remain active until I give up and kill them, but I can't see a window...
2012 Jun 09
7
ActiveRecord::AssociationTypeMismatch in UsersController#update
Hi Im trying to link my User model to a Teams model. I seem to be getting the following errors. Any help would be great as Im just new to RoR Thanks error ActiveRecord::AssociationTypeMismatch in UsersController#update Team(#2183395560) expected, got String(#2174675960) app/controllers/users_controller.rb:67:in `update'' app/control...
2009 Jul 16
9
Please help me understand how arrays are translated in rails
...#39;'m just having trouble making headway into what is probably a very easy subject. I understand arrays with at least 4 other languages but with Ruby I haven''t found a mental connection with how I can assign variables to arrays.. Take for example: def calculate_tsos(model, datavar, teamvar, valvar) var = model.compiled_this_week.find(:all) var.each_with_index do |rows, i| puts "#{model} [ Row #{i} | Team ID = #{rows.team_id} | Team = #{rows.team.name} | #{datavar} = #{rows.__send__(datavar)}" end end This will give me: TotalOffense [ Row 0 | Team ID = 5 | T...
2004 Jul 20
3
wine seti@hom team
For those of you who don't know yet, the Wine project has it's own seti@home team, at http://setiathome2.ssl.berkeley.edu/stats/team/team_172471.html The current objective is to overtake the Microsoft team http://setiathome.ssl.berkeley.edu/stats/team/team_28.html Help is needed, please if you already have seti@home installed. If you don't, it's only 300k to download, ru...
2009 Jul 29
5
[newbie] double relationships in database
I have the following tables teams id :string name :string and matches id: home_team :team_id visitor_team :team_id how can I reflect that kind of relationship in a RoR model? thanks and keep up the good work.
2008 Nov 10
2
Sort model based on max value of has_many field
Hi, I have models such as: class Team < ActiveRecord::Base has_many :games end class Game< ActiveRecord::Base belongs_to :team end So there are many (well, 0 to 6) games for each team. Team game has a "score". I would like to get a list of the teams, sorted by the highest scoring game - sort of a ranking based o...
2008 Nov 13
5
Touch an ActiveRecord - timestamps
When I update an ActiveRecord, i would like to "touch" one of the related objects, that the updated record belongs_to, in order to update the timestamps on the parent record, although i don''t want to change any of the data in the parent. Whats the accepted way to do this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You
2006 May 14
3
Strange Database Mapping Question
...this may cause. Question time: I am trying to write a web application for the staff at my office to play a form of virtual Super14. Its a bit like any of the virtual sports available on the internet except this one is for Rugby. The relevant tables in my database are as follows: create table teams ( id INT AUTO_INCREMENT NOT NULL, name VARCHAR(40), PRIMARY_KEY(id) ); create table games ( id INT AUTO_INCREMENT NOT NULL, date DATETIME, #Date of game home_teams_id INT, #id of home team away_teams_id INT, #id of away team home_team_score INT, #this is not meant to link to another tabl...
2006 Apr 07
3
Folding@Home CentOS Team
All, The CentOS Folding at Home team has cracked the top 10% of all the folding teams. We could use some more members that have CPU Cycles to spare :) Folding at Home is a great distributed computing program that is used to process items for medical research teams. It is similar to SETI at Home (if you are familiar with that). Her...
2010 Jan 25
0
has_many, :finder_sql, setting attributes
Hi all, My question is somewhat complicated, but bear with me. My project has a number of models: User, Program, and Team. Users belong to multiple Programs. Programs have multiple teams, but Teams belong to one program. For each Program a User belongs to, he can belong to multiple Teams. (Think of this in an athletic context where users are athletes, programs are universities). So my models look something li...
2006 Jul 02
1
prevent duplicate inserts with has_many :through ??
Does anyone have an efficient/elegant way to prevent duplicate inserts when using a has_many :through relationship. So I have something like this: class User < ActiveRecord::Base has_many :favorite_teams has_many :teams, :through => :favorite_teams end class FavoriteTeams < ActiveRecord::Base belongs_to :user belongs_to :team end class Teams < ActiveRecord::Base has_many :favorite_teams has_many :users, :through => :favorite_teams end If one user creates a team like '...
2007 Jun 09
7
create 2 fk referencing the same table
Hi everyone! I have a problem with defining 2 fk referencing the same table. I have a Program table and a Team table. The Program should have an away team and a home team fk. From my understanding, "the fk column should be named after the class of the target table, converted to lowercase, with _id appended". But, in my case, I have 2 fk referencing the same table. How can I do this? --~--~------...