Mr. Wynand posted:Yes Rails is all sorts of <3 and puppies, but there are more then a few things about it that make you want to run up a wall in anger when you have to deal with them. You know what's fun? Migrating a database that halfway through used a plugin that isn't installed anymore.
|
|
# ? Aug 10, 2007 21:30 |
|
|
# ? May 15, 2024 02:46 |
|
MrSaturn posted:Speaking of all this migration business, how can I use rake db:migrate to just... add a field to a table? I'm still heavily developing my application, and I often find the need to add columns (as I develop features), and I don't want to have to wipe the contents of my db each time. Often rake db:migrate doesn't seem to do anything. code:
|
# ? Aug 10, 2007 21:33 |
|
Ah, thanks! Regarding migrations, to the naysayers, seriously, look into hobo. this is coming in the next release!
|
# ? Aug 10, 2007 21:40 |
Heeey, UConn CS sophomore here. Any professor/course recommendations?
|
|
# ? Aug 10, 2007 21:43 |
|
I don't like incremental migrations during development beyond setting up the base tables. Everything evolves too quickly and a db:reset with a sql file to load isn't too painful (or load fixture data into your development database). My team is much smaller so we don't run into big problems with database clashes and just tell eachother when we've made a database change. I start using them the 'right' way when the application is in production. I figure I can live with a little inconvenience during development.
|
# ? Aug 10, 2007 21:45 |
|
MrSaturn posted:Ah, thanks!
|
# ? Aug 10, 2007 21:45 |
|
You guys know you're supposed to consolidate your migrations every once in a while, right? You're probably not going to go back to that migration you were using 200 version ago or whatever.
|
# ? Aug 10, 2007 21:53 |
|
vg8000 posted:Yeah but when you try to re-migrate from scratch, you're using [latest model] versus [older database migration] that may not be compatible anymore. He said this himself in his post. code:
Mr. Wynand posted:sooner or later an if RAILS_ENV=="development" is going to slip in your code somewhere... skidooer fucked around with this message at 22:06 on Aug 10, 2007 |
# ? Aug 10, 2007 22:01 |
|
Mr. Wynand posted:sooner or later an if RAILS_ENV=="development" is going to slip in your code somewhere... code:
|
# ? Aug 10, 2007 23:57 |
|
I dismissed Ruby on Rails until this thread, and now I'm really liking what I see. Does anyone know of a good webhost that supports Ruby on Rails? I've checked the hosting threads, but did not see anything that really caught my interest.
|
# ? Aug 11, 2007 04:46 |
|
Tandori Jones posted:I dismissed Ruby on Rails until this thread, and now I'm really liking what I see. Does anyone know of a good webhost that supports Ruby on Rails? I've checked the hosting threads, but did not see anything that really caught my interest. Site5 does https://www.site5.com. I use them for hosting and they are great. Excellent customer support, and great instructions on how to put your RoR app on their hosting.
|
# ? Aug 11, 2007 06:11 |
|
holy poo poo my first quote != edit
|
# ? Aug 11, 2007 06:11 |
|
shopvac4christ posted:gently caress that HTML poo poo, Haml is where it's at. Haml is awesome. We use it at my company and it's just great. I wish we could use sass too, but our designers need to make changes to the css often and don't understand it
|
# ? Aug 11, 2007 07:14 |
|
Before haml existed I tried making a page with Builder because I was sick of the terrible indentation and it was a nightmare. haml looks perfect and sass looks fantastic too, I think I'm going to start using them from now on.
|
# ? Aug 11, 2007 09:37 |
|
Rails is a great webapp framework ruined by a lovely O/R framework.
|
# ? Aug 11, 2007 09:38 |
|
Mr. Wynand posted:... Fair points, I guess it's just refreshing to see a framework that even thinks about these things. They seem to be unknown subjects in the .Net world. What about the other RAD frameworks, like Django or Zope/Plone? Do they have similar development process features?
|
# ? Aug 11, 2007 11:00 |
|
If I'm doing a minor little project I like to use _why's microframework Camping. It's easy as pie to then scale it up to a full blown rails project if I need the space.
|
# ? Aug 11, 2007 14:41 |
|
nebby posted:Rails is a great webapp framework ruined by a lovely O/R framework.
|
# ? Aug 11, 2007 16:27 |
|
skidooer posted:I fail to see how one library can ruin another. ActiveRecord is not a required dependency. You can use whatever persistence layer you want. And is Og any better? Are there any other ORMs for Ruby besides those two?
|
# ? Aug 11, 2007 17:40 |
|
vg8000 posted:Are there any other ORMs for Ruby besides those two?
|
# ? Aug 12, 2007 16:08 |
|
Fork posted:Have you tried looking at Selenium and Watir to do the type of testing your talking about? I'm personally not a big fan of that type of testing because the breakdowns usually occur on the model or controller level anyway, and like you said, it changes way too often to be of much value. Regarding testing not being worth the investment -- I have to say, I've seen some stupid things said about Rails, but that's the first time I've heard that one. I will admit it takes discipline and experience to do it correctly but it does pay off eventually and sometimes in spades. Having said that when 60% of your code is javascript (or, more simply, most of your errors happen in the browser), the lack of proper client-side testing tools becomes a real problem and you really gotta re-evaluate your testing strategy.
|
# ? Aug 15, 2007 01:16 |
|
skidooer posted:You can redefine the model within the migration to solve that problem. Not exactly DRY, but a lot better than trying to manage versioned models in an automated fashion. That's... actually not too bad an approach. We could even take it further and clone the whole app/models dir to db/migrations/00_migration_name/. Would bloat the gently caress out of your code base but it would be a pretty darn reliable way to have data consistency migrations that actually work.
|
# ? Aug 15, 2007 01:22 |
|
ikari posted:
RAILS_ENV should get deprecated and the above should be made the default. Until then you wouldn't be able to do it without breaking plugins. At work we just made our own little loader script that loads a separate database.yml, and runs different test/env/prod configs for each developer and/or deploy target. That actually works very well for us, but the way envs work out of the box is pretty sucky.
|
# ? Aug 15, 2007 01:29 |
|
Mr. Wynand posted:RAILS_ENV should get deprecated and the above should be made the default. Until then you wouldn't be able to do it without breaking plugins. Yeah. The nice thing is that for a while now, database.yml has been run through ERB before being parsed. So using aliases, anchors, and mappings in YAML plus reading in other files by breaking out into ERB, you can actually do a lot of clever things with database.yml alone.
|
# ? Aug 15, 2007 02:52 |
|
Walrus791 posted:Whats everyone using as a Rails IDE? I just installed Apanta/RadRails for Eclipse and its looking very convenient, if a little shallow. Still more then SciTE/Notepad++, but still, a nice IDE goes a long ways.
|
# ? Aug 15, 2007 03:55 |
|
Let's say I've got an item called a house in my database. I want a house to be able to create a room. What syntax do I have to use to get the user that created the house, given only the house object? I thought it'd be likephp:<? :User.find(House['user_id']) ?>
|
# ? Aug 15, 2007 18:46 |
|
edit: misread what you were trying to do
hmm yes fucked around with this message at 19:03 on Aug 15, 2007 |
# ? Aug 15, 2007 19:00 |
|
MrSaturn posted:Let's say I've got an item called a house in my database. I want a house to be able to create a room. What syntax do I have to use to get the user that created the house, given only the house object? I thought it'd be like If the foreign key to the user is called "user_id" then that should work. Is House the house object or the model name? User.find(house[:user_id]) should work If you have a belongs_to :user in your House model, then when you first find the house you can add :include => :user (I think that's the syntax) which will give you house[:user][:username], etc... capabilities.
|
# ? Aug 15, 2007 19:01 |
|
where would I put :include=>user ? edit: see the problem here is I'm trying to set hobo's set_creator_attr to :User.find(venue['user_id']) and I'm getting a code:
php:<? set_creator_attr :User.find(venue['user_id']) ?> MrSaturn fucked around with this message at 19:26 on Aug 15, 2007 |
# ? Aug 15, 2007 19:23 |
|
MrSaturn posted:where would I put :include=>user ? Here's an example: @houses = House.find(:all, :include => :user) and your new favorite page: http://api.rubyonrails.com/classes/ActiveRecord/Base.html#M000992
|
# ? Aug 15, 2007 19:27 |
|
Scarboy posted:Here's an example: well the problem with that call is that I'm in a room, and I have a valid reference to a house, but not to a user. so the :include => :user part wouldn't work, right?
|
# ? Aug 15, 2007 20:01 |
|
MrSaturn posted:well the problem with that call is that I'm in a room, and I have a valid reference to a house, but not to a user. so the :include => :user part wouldn't work, right? code:
code:
|
# ? Aug 15, 2007 20:20 |
|
yeah, that's kinda like it, though the syntax is a bit different because of hobo. it turns out my problem was a mound of different things, but the eventual syntax is this: House.find(:first,:conditions=>[ "user_id = ?", user['user_id']]) out of curiosity, would I be better of replacing my belongs_to :user to a delegate? I've never used delegate.
|
# ? Aug 15, 2007 20:44 |
|
MrSaturn posted:yeah, that's kinda like it, though the syntax is a bit different because of hobo. it turns out my problem was a mound of different things, but the eventual syntax is this: code:
quote:out of curiosity, would I be better of replacing my belongs_to :user to a delegate? I've never used delegate. code:
|
# ? Aug 15, 2007 21:17 |
|
skidooer posted:You probably don't want to replace a belongs_to with a delegate, but it's hard to say for sure without seeing it in context. Well, a room really does only belong to a house, but hobo's user model makes it so that it verifies who can create what using user objects. This is such an odd specific problem, I really appreciate your help. I think I have it working decently for now, though. Thanks so much for your help, the hobo forums really weren't replying.
|
# ? Aug 15, 2007 21:44 |
This isn't a Rails question, but a Ruby question. There's some code I want to use in a project, stuff I got off of RubyForge but didn't come in a gem or anything. What's the 'proper' way to put it in a project of mine? I'd imagine stuffing it all in a 'lib/', pushing that directory onto my load path, and requiring them would work - but what if those projects update? Just replace the files in lib?
|
|
# ? Aug 22, 2007 00:35 |
|
Have there been any quality books written on Hobo? I learn a lot better from paper than from a computer screen. I really dont want to switch browser windows all day long looking up DryML tags.
|
# ? Aug 22, 2007 22:26 |
|
floWenoL posted:... an example of something Ruby does that is done in Perl better. Well, this is a just a silly preference thing, but I like Catalyst and Mason more than RoR. But maybe it's just my unfamiliarity with the RoR way.
|
# ? Aug 22, 2007 22:44 |
|
Hobo is brand new, so there is very little up to date documentation let alone an entire book. You could print off the docs from the website and reference those instead. I have a problem that I am sure is actually really simple: I want to add up and return a total price across a m2m association. Using the generic example, I want to be able to add up the total price of all Books based on an Author. Author habtm :books Book habtm :authors t.column "price", :integer Can anyone help me out?
|
# ? Aug 22, 2007 22:52 |
|
|
# ? May 15, 2024 02:46 |
|
shopvac4christ posted:What's the 'proper' way to put it in a project of mine? I'd imagine stuffing it all in a 'lib/', pushing that directory onto my load path, and requiring them would work - but what if those projects update? Just replace the files in lib? Yes, and yes.
|
# ? Aug 23, 2007 00:37 |