Re: [Rails] add_index question

2011-07-07 Thread Paulo Muggler Moreira
When you want to look up a specific word in a 500-page paper tome, where do you look? That's the same idea as database indexes =) On Thu, Jul 7, 2011 at 09:04, Walter Lee Davis wrote: > > On Jul 7, 2011, at 7:28 AM, Rodrigo Ruiz wrote: > > What is add_index for? >> >> Someone told me it was to

Re: [Rails] Re: error of DEPRECATION WARNING

2011-07-06 Thread Paulo Muggler Moreira
ould_validate_presence_of :category_id > should_ensure_length_is_range :name, (2..128) > > should_have_many :languages > should_have_many :translations > should_have_many :pictograph_sets > end > > but why it does warn me with that error? > > On Jul 6, 10:07 pm,

Re: [Rails] error of DEPRECATION WARNING

2011-07-06 Thread Paulo Muggler Moreira
It is just what it sounds like: a warning that some method, or constant, or whatever it is that you are trying to access, is scheduled to be deprecated in the near future. That is, it will be sent to byte heaven with a few swift swipes of the delete key on next versions of whatever tool it is you a

Re: [Rails] Can't upload files when WEBrick running in daemon mode.

2011-07-04 Thread Paulo Muggler Moreira
I personally use mongrels for my development chops, and passenger in production environments; I have yet to take the unicorn for a ride. I advise you to drop WEBrick entirely. Also, be sure to look at this security considerations if you hav

Re: [Rails] ruby and rails wont work even they're already installed

2011-07-04 Thread Paulo Muggler Moreira
If you can't update Rails or downgrade RubyGems, you need to require 'thread' before boot.rb runs, in three files: Rakefile, script/server, and config/environment.rb. It seems older versions of Rails relied on a require from RubyGems, giving us that delightful error message upon updating RubyGems t

Re: [Rails] Re: Hash each where

2011-06-30 Thread Paulo Muggler Moreira
John's answer. Also, the Ruby Hash API . On Thu, Jun 30, 2011 at 10:10, John Feminella wrote: > only_new_entries = array_of_hashes.select { |h| h[:status] == "new" } > > ~ jf > -- > John Feminella > Principal Consultant, BitsBuilder > LI: http://ww

Re: [Rails] Re: how to connect a form field to a table from another database?

2011-05-17 Thread Paulo Muggler Moreira
The way I understand it, Mauro has his models stored in different databases, i.e., his rails app is running on one DB server (SQLite/PostgreSQL/X) and he wants to fetch data on another DB server (Oracle), is that so? In that case, it would do good to look here: http://api.rubyonrails.org/classes/A

Re: [Rails] Re: Help with authentication/authorisation design

2011-05-17 Thread Paulo Muggler Moreira
I think trying to model all those relationships solely in your user models will turn out way more complicated than adding a few extra models to your app to help capture those relationships. Your concerns about data coupling are valid, but at some point, you'll have to store the information about wh

Re: [Rails] Help with authentication/authorisation design

2011-05-17 Thread Paulo Muggler Moreira
Not sure I understand whether the problem is capturing the business relationships in your Rails models, or applying your authorization frameworks to your app. Hope this helps a bit: It seems to me you would want to associate your Customers, Mechanics, and Garage Owners to some sort of Garage model

Re: [Rails] Re: ActiveRecord - default ID vs custom identifier

2011-05-17 Thread Paulo Muggler Moreira
Don't forget, you can also add a database index to a field that is going to be searched often, that will improve search performance. In your model's migration: add_index(table_name, column_names, options) from: http://api.rubyonrails.org/classes/ActiveRecord/Migration.html

Re: [Rails] how to configure ruby-on-rails with apache

2011-05-17 Thread Paulo Muggler Moreira
What environment are you coming from? Unix, Mac, Windows? Let's assume you're using some Unix variant, as you should, and Apache2 is already properly installed: 1. install phusion passenger: $ gem install passenger 2. install passenger-apache2-module: $ passenger-install-apache2-module Be sure

Re: [Rails] Rails 3.1(beta1) + SASS + variables

2011-05-06 Thread Paulo Muggler Moreira
Maybe you're looking for something along the lines of @import? http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import regards, Paulo Muggler On Fri, May 6, 2011 at 06:11, Tomas Celizna wrote: > Hello all, > > in Rails 3.1, is it possible to define global SASS variables (and mixins)