|
So I'm trying to get into programming 2.1 however a lot of material is either for rails 1.2/1.4 or some older version of rails. Is there a site that discusses the changes between previous version of Rails and what Rails is at the moment?
|
# ¿ Jul 8, 2008 00:51 |
|
|
# ¿ Apr 26, 2024 22:22 |
|
My company is trying to transfer a Rails app over from MySQL to an Oracle database. Unfortunately due to the way Rails creates table names, there is a table name that is 37 characters in length. Oracle only allows for 30 character object names. Renaming the table / renaming the class object is currently out of the question since it is part of an open source project. Is there anyway in Rails to specify that when table X is being referenced it should actually look at table Y rather than the rails converted name for table X?
|
# ¿ Mar 8, 2012 00:27 |
|
Fangs404 posted:I posted this on StackOverflow, but I haven't really had a response, so I figured I'd ask here. This problem has just really stumped me. Well if its possible that RAILS_GEM_VERSION is already defined as 3.0, then it won't set it to 1.2.3. Also try running the Rails app through Webrick and see if its actually Mongrel or a Rails problem. This looks like a Rails/Gem issue.
|
# ¿ Mar 14, 2012 20:12 |
|
Physical posted:Is there something that I don't know that prevents me from assigning a value to a key in a hash.each loop? First you are manipulating on a local object, v, so when you exit the scope of the block its just going to be erased. Second, I don't know what the keys in data are since I can't see any input. But your loop is going to erase every single value in the hash and then create a hash as the new value wherein it contains the department's id correlating with the staff, but will subsequently overwrite that hash value everytime a staff has that department id (assuming you could even manipulate local variables). Without being able to see the actual data structures for each object, this seems really unstructured. Lamont Cranston posted:Just setting v won't do it; you'll have to do data[k] = (your new v). inject is essentially a reduce, how is that going to help him here? I am guessing you're referring to mapping?
|
# ¿ Mar 28, 2012 03:10 |
|
Lamont Cranston posted:Well yes, but map returns an array. I was thinking he could do something like Ah yes I kept thinking that the object returns as an array of hashes and not a hash. Still your solution doesn't actually modify `data`, it just returns a copy such that data is still not changed.
|
# ¿ Mar 28, 2012 04:04 |
|
So we are suppose to pay him money to "fix" Rails in Mac OSX because he/they made it way too complicated? Edit: Oh I see he's making a Mac app. Now the complaints about, "does Yehuda Katz know ObjC?" make more sense Strong Sauce fucked around with this message at 01:42 on Mar 29, 2012 |
# ¿ Mar 29, 2012 01:38 |
|
Smol posted:You mean this? Apple has made an 'official version' based off his stuff http://kennethreitz.com/xcode-gcc-and-homebrew.html http://developer.apple.com/downloads Look for Command Line Tools for XCode
|
# ¿ Mar 30, 2012 18:19 |
|
So I have 2 model types, Leagues and Players. Leagues can have Players, and Players can be in different Leagues. You can add players and leagues separately, but I'm trying to assign an already created player to the current league. Before I would just do League.find(params[:league_id]).players.create(params[:player]) to add players to a league, but that method doesn't help me much for existing players. Essentially what I want to do is just add into the join table that player with :player_id is now also in league :league_id. But I don't want a new entry in the player table. I haven't done Rails in a while so I'm blanking out here. Any help?
|
# ¿ May 31, 2012 09:49 |
|
8ender posted:
For the most part, although I changed it as Player.find(params[:player_id]).leagues << League.find(params[:league_id]) This worked, however now I run into another problem where Rails is not pointing to the correct route when I just want to delete the player from the league and not the player itself. Here is my routes table code:
code:
|
# ¿ May 31, 2012 17:19 |
|
Yeah that's probably going to be the best solution. Still odd that Rails won't override the route though.
|
# ¿ May 31, 2012 18:03 |
|
BonzoESC posted:Routes don't "override" until they're evaluated at request time. When you DELETE that route, what action does it route to? When I say override, I meant I specify a different route in routes.rb. When I run rake routes it's suppose to generate what the proper routes should be, and it seems to duplicate the same route. The other route I overrode, "post 'leagues/:league_id/players/' => 'players#create_league_player'" right underneath the DELETE route doesn't show up subsequently down the route path. However the DELETE route still shows up when it's suppose to be overridden. Right now the route is still using ,"players#destroy" rather than "player#drop_from_league"
|
# ¿ May 31, 2012 18:37 |
|
BonzoESC posted:Did you try moving your drop_from_league declaration below the resources? So moving it below the resources didn't work, but excluding destroy method works! Thanks! Still odd though.
|
# ¿ May 31, 2012 19:57 |
|
|
# ¿ Apr 26, 2024 22:22 |
|
etcetera08 posted:Not Rails-related, but since we don't have a Ruby thread.. I am having a weird thing where a Which versions of lastfm and dependency gems are you using? Usually when that error occurs it is some kind of infinite recursion problem but that probably won't help you solve this problem.
|
# ¿ Jun 23, 2012 19:17 |