Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Taliesin
Aug 15, 2002

Shake it Baby!

The Journey Fraternity posted:

why the lucky stiff, maybe?

YESSSSS!!!! Thank you.

Adbot
ADBOT LOVES YOU

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

shopvac4christ posted:

You mean code coverage? Like rcov?

And regarding Haml - you can use all HTML elements. Using semantically incorrect divs is the fault of the programmer.

I saw that you CAN use HTML elements, but the style seems to encourage making everything divs (as does the giant example on the homepage).

Walrus791
Sep 4, 2002

Ugly, greasy retard.
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.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

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.
Rails is a very dynamic language that's mostly impossible to do any kind of static analysis on, so I'm still torn on what the actual benefit of an IDE is for Ruby/Rails other than maybe basic integration with a revision control system. I just use syntax-highlighting editors for the most part: Programmer's Notepad 2 on Windows and Kate/vim on Linux. It's not exactly difficult running the script/generate stuff or script/server mongrel from the command line.

RadRails is pretty cool, but it's crashed on me five or six times in a week before, and I can't say I've ever had that problem with a regular text editor. Considering RadRails adds little value besides loving up my indentation when I'm trying to code, and sticking in end tags where I don't want them, I decided to pass.

I should also note that the multi-monitor support in Eclipse is absolutely awful.

Vulture Culture fucked around with this message at 14:07 on Aug 9, 2007

vg8000
Feb 6, 2003

You never question Heylia's eyeballing. That's the rainman of weed right there.

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.

I just use Textmate and have autotest, mongrel, and script/console open in different terminals as I develop. More window clutter but I never got into Eclipse/Radrails.

Fork
Aug 5, 2004

RonaldMcDonald posted:

Running random eval()s from the Interweb is a good idea c/d?

Confirming because it's why the lucky stiff.

ANAmal.net
Mar 2, 2002


100% digital native web developer

bitprophet posted:

I probably shouldn't even post in this thread, not having used Rails yet (started reading Ruby tutorials the other day, though, as my new job may have me doing some Rails work) but: how are the mentioned tools different from using e.g. Firebug or the Web Developer FF extension?

They're different in that they run on the server. The way script console works, you get a line-by-line Ruby environment, where you can do anything you could do in a RoR page. I don't think I ever hit the database directly, once I started using that. You want to ban someone? User.find(4).ban Check the size of the posts table? Posts.find_all().length

It's really goddamned useful for fixing models and controllers. Firebug is to CSS and HTML what Script console is to Ruby.

Breakpoints are placed in the site code, in any model, view, or controller. When the code hits that line, it stops executing, and you get control over it in the console at that point. So if variables aren't displaying right or something, throw in a breakpoint, and see what the value is exactly at that point in the code.

Seriously, the debugging tools are about the only reason I'd ever use Rails.

bitprophet posted:

(...and will I be the only RoR user who has a dislike for the David Hanssen style of "arrogance and overstatement is awesome" showmanship? :v:)

No, that's actually a big turn-off for me, too. I kind of stopped reading the 37Signals blog after his little conference stunt.

Basically, he did a talk about the future of Rails, and at the end, he said that if you don't like the way rails is going, gently caress you. Seriously, the last slide was just that.

slobodan
Aug 2, 2000

ANAmal.net posted:

Basically, he did a talk about the future of Rails, and at the end, he said that if you don't like the way rails is going, gently caress you. Seriously, the last slide was just that.

The thing with having someone like DHH as the face of Rails, you kinda only have to ignore the one megalomaniac. I'd probably prefer that to watching a few egos fighting for top dog. I just wish DHH would learn to say 'we' a little bit more often. It always appears like he's constantly taking credit for other people's work (ie. the recent Rails logo rant). You just gotta laugh! The next generation of Baby Boomers are here :(

ElCondemn
Aug 7, 2005


ryanmfw posted:

You keep comparing apples and oranges. Ruby is not an MVC framework, just like PHP. RoR, and PHP along with the several well developed frameworks like CakePHP, Symfony, and CodeIgniter make MVC development easy. Ruby itself does not make it easier, just like PHP itself does not.

This is exactly why I don't understand what the big deal about ruby is. Sure it has an "official" framework but other than that I don't see any benefits.

Like that other dude said in his argument against perl, the only thing perl excels at compared to ruby is in performance and aesthetics(not sure I agree with that but I'll take it), but what else is there?. I just can't figure out a niche or function that Ruby/RoR fills for me as a developer.

ANAmal.net
Mar 2, 2002


100% digital native web developer

slobodan posted:

The thing with having someone like DHH as the face of Rails, you kinda only have to ignore the one megalomaniac. I'd probably prefer that to watching a few egos fighting for top dog. I just wish DHH would learn to say 'we' a little bit more often. It always appears like he's constantly taking credit for other people's work (ie. the recent Rails logo rant). You just gotta laugh! The next generation of Baby Boomers are here :(

He just comes off like a prick, is all I'm saying.

hey mom its 420
May 12, 2007

legalcondom posted:

I just can't figure out a niche or function that Ruby/RoR fills for me as a developer.
More web 2.0

Walrus791
Sep 4, 2002

Ugly, greasy retard.

slobodan posted:

The thing with having someone like DHH as the face of Rails, you kinda only have to ignore the one megalomaniac. I'd probably prefer that to watching a few egos fighting for top dog. I just wish DHH would learn to say 'we' a little bit more often. It always appears like he's constantly taking credit for other people's work (ie. the recent Rails logo rant). You just gotta laugh! The next generation of Baby Boomers are here :(

Its unfortunate that DHH is doing things the way he is, but alot of smart people are equating a languages popularity has a factor in its success. So is he a dick? yeah, but I think it might help rails in the long run. No press is bad press

bitprophet
Jul 22, 2004
Taco Defender

ANAmal.net posted:

They're different in that they run on the server.
[...]
Seriously, the debugging tools are about the only reason I'd ever use Rails.

Interesting. In Django you can use the Python shell to do the same things you just described, so in a general use-case ("let me modify object X or get a count of how many Y objects I have") it doesn't sound terribly unique.

However, the ability to set breakpoints in a web development environment is nice; I'm sure there's an analogue in Python but it would probably require using Django's development runserver (similar to but not intended for real server use as Mongrel) and plenty of 'pdb' usage. I'll have to root around and see if anyone has thought of something like that for Django :)

ANAmal.net posted:

No, that's actually a big turn-off for me, too. I kind of stopped reading the 37Signals blog after his little conference stunt.

Yea. I also found it telling that the copyright info on rubyonrails.org mentions David first and the community second:

rubyonrails.org posted:

Ruby on Rails was created by David Heinemeier Hansson
[...]
"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.

It also mentions 37signals, but that makes sense, as few large open source projects can have decent development/marketing/hosting/etc without a genesis at a company - Django's is the Lawrence Journal-World, a Kansas newspaper, and it says so on the Django site. However, that's all that is mentioned there - the core development team tends to not care too much about getting their names out in the way that David does.

That said, there's no question that David's marketing and personality have played a large part in getting Rails the mindshare it currently has, which is only a good thing for Web development as far as I'm concerned. The less people using regular code-soup PHP, even if it means they just move to a PHP MVC framework, the better.

skidooer
Aug 6, 2001

legalcondom posted:

This is exactly why I don't understand what the big deal about ruby is.
In most popular web development languages you write a program. In Ruby you write programs that write programs. The latter lends itself very well to web development. The only problem I see is that these Ruby idioms usually are not apparent to the Ruby novice, so they end up writing PHP-like code, only with Ruby syntax, and fail to see what the big deal really is.

bitprophet
Jul 22, 2004
Taco Defender

skidooer posted:

In most popular web development languages you write a program. In Ruby you write programs that write programs. The latter lends itself very well to web development. The only problem I see is that these Ruby idioms usually are not apparent to the Ruby novice, so they end up writing PHP-like code, only with Ruby syntax, and fail to see what the big deal really is.

This is the same with any framework, especially Ruby/Python ones: it's not just different syntax and different organization, it's different ways of thinking about the problems and approaches to solving them. I say "especially Ruby/Python" because those sorts of languages encourage doing things in an intelligent manner, both by virtue of what their syntax allows as well as the communities and tools surrounding them.

take boat
Jul 8, 2006
boat: TAKEN

legalcondom posted:

This is exactly why I don't understand what the big deal about ruby is. Sure it has an "official" framework but other than that I don't see any benefits.

Like that other dude said in his argument against perl, the only thing perl excels at compared to ruby is in performance and aesthetics(not sure I agree with that but I'll take it), but what else is there?. I just can't figure out a niche or function that Ruby/RoR fills for me as a developer.

I'm not sure what your point is; in one post you make a framework comparison and ask what's the buzz around Rails about, in the next you say you don't want a framework comparison and say anything Ruby can do Perl can do better. Ruby is a unix-oriented scripting language with a number of libraries built for it, and it combines a number of programming paradigms and clever language tricks and syntax in a way that many find elegant and usable. Perl, by contrast, is a unix-oriented scripting language with a number of libraries built for it, with a syntax that is nothing short of god awful. Much like Perl and PHP and Python, Ruby has no special domain where only it can ever be used.

Also whatever database you're using must be pretty awesome if it knows how to automatically keep an updated age field :shobon:

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

take boat posted:

Also whatever database you're using must be pretty awesome if it knows how to automatically keep an updated age field :shobon:

Umm, MSSQL and Oracle can both do this - I do think it's better that it's done by the business logic, but it's not exactly a way-out-there feature.

Besides, it's trivial for any even vaguely OOP language to compute a fields value based on the value of other fields.

ElCondemn
Aug 7, 2005


take boat posted:

Ruby is a unix-oriented scripting language with a number of libraries built for it, and it combines a number of programming paradigms and clever language tricks and syntax in a way that many find elegant and usable. Perl, by contrast, is a unix-oriented scripting language with a number of libraries built for it, with a syntax that is nothing short of god awful. Much like Perl and PHP and Python, Ruby has no special domain where only it can ever be used.

Alright, that's all I wanted to know, it's just a preference in synax. I guess my issue is just that I'm used to perl, php and other languages that are similar. It's kind of difficult for me to pick up/use ruby because it's quite different and the approach is different than what I'm used to.

take boat
Jul 8, 2006
boat: TAKEN

enki42 posted:

Umm, MSSQL and Oracle can both do this - I do think it's better that it's done by the business logic, but it's not exactly a way-out-there feature.
Really? You can fake it in MySQL using views, I know, but do you mean they have an actual age field? I am not exactly up on databases though so either way would not surprise me.

Xesis
Jul 11, 2002

take boat posted:

Really? You can fake it in MySQL using views, I know, but do you mean they have an actual age field? I am not exactly up on databases though so either way would not surprise me.

You can use stored procedures/triggers (also available in postgresql) to do this kind of stuff.

Roloc
Apr 6, 2005

legalcondom posted:

Alright, that's all I wanted to know, it's just a preference in synax. I guess my issue is just that I'm used to perl, php and other languages that are similar. It's kind of difficult for me to pick up/use ruby because it's quite different and the approach is different than what I'm used to.

I am actually in the same boat as you. However I fear being stagnant and not at least trying out the next new things. I feel like this with Ruby, as well as Flex and Silverlight technologies.

However I think with syntax simplicity comes improved productivity and better maintainability. So there is some benefit to having a "lighter" syntax. Not even mentioning the forced MVC architecture.

My issue now is more of how well does it integrate with web servers, that will overall effect my adaptation to it or not. I have always had an issue with deploying Java technology on a single server with both a web server and an app server, I know this isn't required but it seems to be the norm.

Found these:
http://www.modruby.net/en/ -- Apache
http://made-of-stone.blogspot.com/2006/01/rails-on-iis-revisited.html -IIS

I like this setup though much better than Tomcat or Websphere for example, although both are super powerful it would be nice to have a middle solution, much like I use PHP for now.

The IIS one seems like a huge PITA which concerns me. Not that I am a huge fan of IIS but some of my clients are, anyone know a better way?

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

take boat posted:

Really? You can fake it in MySQL using views, I know, but do you mean they have an actual age field? I am not exactly up on databases though so either way would not surprise me.

Not age specifically, but MSSQL and Oracle (I'm about 90% sure for oracle) have computed fields. Plus of course you can always use stuff like views.

vg8000
Feb 6, 2003

You never question Heylia's eyeballing. That's the rainman of weed right there.

Roloc posted:

The IIS one seems like a huge PITA which concerns me. Not that I am a huge fan of IIS but some of my clients are, anyone know a better way?
The simple answer is don't use Rails on Windows in production. It really really sucks and very few people are doing anything about it.

That said I have a Rails app in production on a Windows server (internal app for the company I work for). I have Apache on the front proxying to mongrel for this one app, and proxying to IIS for the other apps on the server. It's not pretty but it works and the app gets low traffic so performance isn't really an issue.

MrSaturn
Sep 8, 2004

Go ahead, laugh. They all laugh at first...
Hey, a rails question!

so I'm trying to create a new model in my application. It's going to be a hobo model, which I've created in the past. For whatever reason, I can't get
code:
rails script\generate hobo_model blogpost
to do anything!

It just outputs like this:
code:
c:\ruby\rails_apps\myapp>rails script\\generate hobo_model blogpost
      exists
      create  app/controllers
File exists - script\\generate

c:\ruby\rails_apps\myapp>
note I'm running this in windows, and I have run use_ruby.cmd, so I'm in the rails environment, or whatever.

What am I doing wrong?

Scarboy
Jan 31, 2001

Good Luck!

MrSaturn posted:

Hey, a rails question!

so I'm trying to create a new model in my application. It's going to be a hobo model, which I've created in the past. For whatever reason, I can't get
code:
rails script\generate hobo_model blogpost
to do anything!

It just outputs like this:
code:
c:\ruby\rails_apps\myapp>rails script\\generate hobo_model blogpost
      exists
      create  app/controllers
File exists - script\\generate

c:\ruby\rails_apps\myapp>
note I'm running this in windows, and I have run use_ruby.cmd, so I'm in the rails environment, or whatever.

What am I doing wrong?

Why are you prefixing script\generate by rails? It should be ruby if anything.

Sir Chicken Caesar
Feb 19, 2005

Cock a doodle don't
Fun Shoe
The major reason Rails rocks for me is that it makes good practice easy. In fact a lot of the time it's harder to behave badly. You guys have already mentioned the MVC pattern support, but you also get things like:

- Great testing support, automatic creation of functional and integration test skeletons. I'm currently investigating Selenium on Rails http://www.openqa.org/selenium-on-rails/ which looks like a good solution to getting front end tests automated as well :-)
- Fixtures for generating test data
- Support for multiple environments baked in
- Migrations that make evolving databases easy

I'm working on a large .Net project at the moment and one of the major frustrations I am have is that when you open Visual Studio you get a blank canvas.

What happens when you get a blank canvas? You either:

a) End up with a mass of developers with varying skill levels making their own little bit of the system in a particular style. This gives you a maintenance and integration nightmare.

b) spend ages investigating and educating people about options for unit testing, deployment, system structure etc. etc.

I'm happy that Rails (in a large subset of contexts) presents a complete environment for development that other so called 'Enterprise Strength' frameworks lack. This leaves me to concentrate on the important bits, i.e. fulfilling the requirements. I just wish I could persuade the senior people at my company that we're missing a trick by not using it more!

Roloc
Apr 6, 2005

vg8000 posted:

The simple answer is don't use Rails on Windows in production. It really really sucks and very few people are doing anything about it.

That said I have a Rails app in production on a Windows server (internal app for the company I work for). I have Apache on the front proxying to mongrel for this one app, and proxying to IIS for the other apps on the server. It's not pretty but it works and the app gets low traffic so performance isn't really an issue.

Thank you that probably saved me a few headaches. It is tough for me to buy into Ruby as a solution then because I have to be able to suggest stuff that works well on Windows since most of my business is with the State of California and they have been hard sold on .NET stuff.

I am going to keep it in mind should a decent Linux contract come along.

MrSaturn
Sep 8, 2004

Go ahead, laugh. They all laugh at first...

Scarboy posted:

Why are you prefixing script\generate by rails? It should be ruby if anything.

touche. It was supposed to be ruby. Brain fart, I guess. That fixed it!

Scarboy
Jan 31, 2001

Good Luck!
Here's a question because I've never messed with this before. I have a method_missing method in my ActiveRecord Model that intercepts two kinds of dynamic method calls. It does this well and everything is fine and dandy, however, all the other dynamic methods that ActiveRecord uses are not recognized now. If I get no result how do I call ActiveRecords base method_missing to do whatever it has to do or raise exceptions?

skidooer
Aug 6, 2001

Scarboy posted:

If I get no result how do I call ActiveRecords base method_missing to do whatever it has to do or raise exceptions?
Call super to pass it up to the superclass. For example:
code:
def method_missing(symbol, *args, &block)
  whatever_you_need_to_do(symbol, *args, &block) || super
end

Scarboy
Jan 31, 2001

Good Luck!

skidooer posted:

Call super to pass it up to the superclass. For example:
code:
def method_missing(symbol, *args, &block)
  whatever_you_need_to_do(symbol, *args, &block) || super
end

Strange, I tried just that and I don't think it worked. I'll try again, maybe I hosed something up. This is what I get for implementing permissions as an quasi bitfield in the database.

Jackdonkey
May 31, 2007
i just started using rails 6 months ago. I work at one small company that are foolish enough to pay me to work all day long learning/writing code for cad macros or the database. My app folder in my project is up to 1.56 megs worth of code, but I still don't know crap. My database looks pretty, goes fast, and uses all free software though so works happy.

I haven't figured out how to sort some stuff though,
like
user_id
qc_user_id

they both link to the same user table so I can't figure out how to sort by qc_user's name instead of the integer. Whatever I'll get it someday. It's been in operation now for about 1.5 months with no major problems, other than importing the customer pricing wrong on the first day, but that was just a simple fix to the code and reimporting.

I even use WIN32OLE to link up with access to print reports, haven't figured out how to make reports that are 2 or more records though, just 1 at a time now :( for the paperwork that goes through the shop. So I guess access isn't free, but the rest of the software is.

I'm still pretty clueless on programming, but at least I can go from cad data file to a cnc file using a ruby script :) But the best part is i'm getting paid to learn basically, and I don't have to talk to customers anymore, hooray, I like ruby, and rails is cool too.

skidooer
Aug 6, 2001

Jackdonkey posted:

Whatever I'll get it someday.
code:
find(:all, :select => 'items.*',
     :joins => 'INNER JOIN users ON items.qc_user_id = users.id',
     :order => 'users.name')

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I have a pretty serious question regarding rails log files in production. Every time a page is visited in your rails application there is a minimum of about 6 lines of information written about it to the log.

Some plugins such as better_nested_set which is pretty drat well near necessary for some applications, there is a command that is going to be depreciated in an upcoming version of rails so you get about 30 or 40 (or however many rows of information are in your database) lines of text written to your log file, each one with a long description telling you about it.

On a traffic heavy web site this log file will eventually get really big right? Isn't that bad? Regardless I want to turn it off.


Thanks. vvvv Related to this is there a good place to figure out what environment.rb is not used for?

Nolgthorn fucked around with this message at 20:28 on Aug 10, 2007

vg8000
Feb 6, 2003

You never question Heylia's eyeballing. That's the rainman of weed right there.

Nolgthorn posted:


On a traffic heavy web site this log file will eventually get really big right? Isn't that bad? Regardless I want to turn it off.
environment.rb or production.rb
code:
ActiveSupport::Deprecation.silenced = true
more info: http://ryandaigle.com/articles/2006/12/04/how-to-turn-deprecation-warnings-off-in-rails

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

Sir Chicken Caesar posted:

The major reason Rails rocks for me is that it makes good practice easy. In fact a lot of the time it's harder to behave badly. You guys have already mentioned the MVC pattern support, but you also get things like:

- Great testing support, automatic creation of functional and integration test skeletons. I'm currently investigating Selenium on Rails http://www.openqa.org/selenium-on-rails/ which looks like a good solution to getting front end tests automated as well :-)
Run away! Run as fast you can! It looks great but in practice the tests are a massive pain to write and maintain. The other problem is that it's often buggy, inconsistent across browsers and just plain not an accurate simulation of true user interaction.

For example, say you're trying to test a custom auto-complete field (like google suggest) - if you use the 'type' command you'll find that the form field gets a value but keyup/down/press events never get sent. If you send the events explicitly some browsers get both the event and fill in values while others only get the events (and some do neither). Now you have to test around browser problems, which also defeats part of the purpose for automated browser testing.

Maintainability wisely, the problem is that you write your tests as a series of commands and tests with basically no modularity or logic to them. This is about as easy to extend and reuse as assembler. The hooks for targeting a particular element are inadequate (especially when trying to locate an element that was just inserted via AJAX and whose ID depends on the database in a hard to predict way) and you end up writing a lot of tests that depend on some insignificant UI detail. If that UI detail changes, test suddenly start failing and you have to re-write and debug a whole suite, wasting countless hours, for something that shouldn't even have affected the tests.

God help you if you actually want to change the workflow of a handful of pages - you almost always have to re-write (and debug!) any tests that have anything to do with it, again, because of a complete lack of modularity. It's up to you to implement such modularity, but you'll find that the whole thing is just a real pain in the rear end to work with.

In my experience, it's not worth the investment - not even close.


quote:

- Fixtures for generating test data
Fixtures, as they ship with rails, are crap for actual unit testing. You have some records that are used for some tests but not others, and very often they make it hard to test particular scenarios, so you just end up generating test data by hand more often then not. This plugin attempts to correct this problem, although I haven't tried it yet.

quote:

- Support for multiple environments baked in
Except a lot of code depends on "development", "test" and "production" explicitly. It shouldn't, but it very often does (plugins are especially bad at this - and face it - sooner or later an if RAILS_ENV=="development" is going to slip in your code somewhere...). So even though you can make your own enviornments in theory, in practice, it's a lot more headache then just swapping out prod/dev/test through some lovely hack for different deployment targets.

quote:

- Migrations that make evolving databases easy
Except when you need a migration to also perform some data sanitation between migrations (i.e. you have a new required field and you want to somehow fill it in for existing records). A really wonderful thing happens when you try to do this: Initially it works and there are no problems. Then you keep working on your app and your models gain more fields and validations, and loose some others. Then somebody tries to apply the migrations from scratch. Well, the code you wrote a few migrations ago assumed the models to work in whatever state they were in what you wrote the migration. But they won't! Some fields will be missing and some other validation requirements will have been added, so your migration will stop halfway through and complain. Then you try to fix it, and you realize that you can't without having a migration fail earlier on, or later on, because it's absolutely impossible to reconcile versioned migrations with unversioned models.

Migrations are still really awesome otherwise, but man, they really have some glaring problems left in them that nobody seems interested in tackling.


---

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.

Fork
Aug 5, 2004

Mr. Wynand posted:

Run away! Run as fast you can! It looks great but in practice the tests are a massive pain to write and maintain. The other problem is that it's often buggy, inconsistent across browsers and just plain not an accurate simulation of true user interaction.

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.

Mr. Wynand posted:

Except a lot of code depends on "development", "test" and "production" explicitly. It shouldn't, but it very often does (plugins are especially bad at this - and face it - sooner or later an if RAILS_ENV=="development" is going to slip in your code somewhere...). So even though you can make your own enviornments in theory, in practice, it's a lot more headache then just swapping out prod/dev/test through some lovely hack for different deployment targets.

This is crazy.

Mr. Wynand posted:

migrations

You do know you can use ActiveRecord inside your migrations to do data manipulation/sanizations between migrations?

vg8000
Feb 6, 2003

You never question Heylia's eyeballing. That's the rainman of weed right there.

Fork posted:


You do know you can use ActiveRecord inside your migrations to do data manipulation/sanizations between migrations?
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.

Fork
Aug 5, 2004

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.

Ah oops. I misread what he was saying.

Adbot
ADBOT LOVES YOU

MrSaturn
Sep 8, 2004

Go ahead, laugh. They all laugh at first...
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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply