[Rails] Re: Rails 3.o

2009-09-02 Thread Maurício Linhares
there's no reason to buy any other book. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Sep 2, 2009 at 9:39 PM, rails.n...@gmail.comrails.n...@gmail.com wrote: So... Beginning Rails 3 is supposedly due Sept 2009 http://www.apress.com/book/view

[Rails] Re: Rails 3.o

2009-09-02 Thread Maurício Linhares
It's still a loose timeline, but it should be available close to the end of this year/beginning of the next. But this is more guessing than real science. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Sep 2, 2009 at 11:09 PM, railsnerdrails.n

[Rails] Re: Ruby on Rails Project Opportunities

2009-09-01 Thread Maurício Linhares
googlemail is used in UK as they already had another company using the gmail name. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Sep 1, 2009 at 7:59 PM, Marnen Laibow-Koserrails-mailing-l...@andreas-s.net wrote: Trausti Thor Johannsson wrote

[Rails] Re: How to refactor the following 2 function (4 lines each)

2009-08-27 Thread Maurício Linhares
def normalize(property) result = normalize_generic(self.send(property)) self.send(#{property}_min=, result[:min]) self.send(#{property}_max=, result[:max]) self.send(#{property}=, result[:display]) end object.normalize(:size) object.normalize(:budget) - Maurício Linhares

[Rails] Re: How to refactor the following 2 function (4 lines each)

2009-08-27 Thread Maurício Linhares
] self.#{property} = result[:display] end ! end - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Aug 27, 2009 at 11:35 AM, Axinte Logoal...@evo-green.fr wrote: Thank you both for your feedback. Based on your suggestions, I've finally

[Rails] Re: How to refactor the following 2 function (4 lines each)

2009-08-27 Thread Maurício Linhares
Yes, you're defining and method and using send at every call, my solution will generate a method with direct calls instead of sending them. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Aug 27, 2009 at 5:24 PM, Axinte Logoal...@evo-green.fr wrote

[Rails] Re: add symbol in collection_select helper

2009-08-24 Thread Maurício Linhares
%= f.select :report_ids, @reports.map { |r| [#{r.name} #{r.surname}, r.id] } , {}, :multiple = true, :size = 10 % - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Aug 24, 2009 at 5:57 AM, Aldo Italorails-mailing-l...@andreas-s.net wrote: hi, i

[Rails] Re: Does link_to_remote degrade to an HTML request?

2009-08-24 Thread Maurício Linhares
It will not degrade automatically, you'll have to tell it to do so adding an :href property: link_to_remote Delete this post, { :update = posts, :url = { :action = destroy, :id = post.id } }, :href = url_for(:action = destroy, :id = post.id) - Maurício Linhares http

[Rails] Re: Quick questions on extensions/overrides

2009-08-24 Thread Maurício Linhares
your code is run, which is usually what you're looking for. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Aug 24, 2009 at 1:30 PM, BallaBallba...@sogetthis.com wrote: I meant this in a more general way. Where should I put overrides. The example

[Rails] Re: backwards compatibility

2009-08-24 Thread Maurício Linhares
I've never seen something like that but why would you ever want to revert your code to work on a previous version? The only possible solution is to add a lot of ifs to every single thing that changed. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr

[Rails] Re: WHy is rails so annoying to deploy?

2009-08-24 Thread Maurício Linhares
and you can either change it to point to ActionController::Request or use an old Rails version. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Aug 24, 2009 at 10:26 PM, Arthur Ratsrails-mailing-l...@andreas-s.net wrote: I've been having great fun

[Rails] Re: Routing problems for different formats

2009-08-23 Thread Maurício Linhares
, avoid mapping URLs directly as you're doing, these paths should be mapped using resources. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sun, Aug 23, 2009 at 6:53 PM, Chris Olsenrails-mailing-l...@andreas-s.net wrote: Maurício Linhares wrote: Without

[Rails] Re: Master/Slave database setup with Rails?

2009-08-20 Thread Maurício Linhares
connection as needed. Shout if you have any troubles using it. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Aug 20, 2009 at 10:39 AM, Yanni Macrails-mailing-l...@andreas-s.net wrote:  Linhares wrote: http://github.com/mauricio/master_slave_adapter

[Rails] Re: How to get current time including milliseconds for div id?

2009-08-19 Thread Maurício Linhares
Time.now.to_i - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Aug 19, 2009 at 12:35 PM, James Westrails-mailing-l...@andreas-s.net wrote: I need to auto generate a guaranteed to be unique number or string to be used something like

[Rails] Re: Master/Slave database setup with Rails?

2009-08-19 Thread Maurício Linhares
http://github.com/mauricio/master_slave_adapter/tree/master - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Aug 19, 2009 at 4:05 PM, Yanni Macrails-mailing-l...@andreas-s.net wrote: I installed masochism and it works very well.  The only problem

[Rails] Re: Potential concurrency issues with a global hash to reduce DB

2009-08-17 Thread Maurício Linhares
If you're not running on rails threadsafe! mode you'll have no concurrency issues. A messaging queue could also be a solution to your problem. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Aug 17, 2009 at 8:56 PM, Frank Poorails-mailing-l

[Rails] Re: JRuby vs Ruby: why would you ever use ruby?

2009-08-16 Thread Maurício Linhares
if you have a machine with multiple processing cores (something that's as common as a keyboard and a mouse nowadays) your server can benefit from them without a separate process and all the monitoring/memory/OS footprint that this solution carries. - Maurício Linhares http

[Rails] Re: Active Record Session expiration in Rails 2.3

2009-08-11 Thread Maurício Linhares
On Tue, Aug 11, 2009 at 10:35 AM, Marc Hassmanrails-mailing-l...@andreas-s.net wrote: 4. Need multiple app servers to scale by using the same data store. Cookie based session store does that without hitting your database server. - Maurício Linhares http://codeshooter.wordpress.com/ | http

[Rails] Re: A big paginate plugin problem

2009-08-10 Thread Maurício Linhares
RailsSpace is clearly outdated and that old paginate method should not be used anymore. You're better served getting a newer book like the latest Agile web development with Rails. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Aug 10, 2009 at 5

[Rails] Re: Where to put generic classes

2009-08-07 Thread Maurício Linhares
Under the lib folder. Or as a plugin. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Aug 7, 2009 at 3:09 PM, skibud2mike.hallo...@gmail.com wrote: I have a file that has a generic class that supports serialization to/ from files. Where should

[Rails] Re: [Rails]Glove.class_name = 'Glofe'

2009-08-05 Thread Maurício Linhares
class_name isn't a real method, try Glove.class.name instead. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Aug 5, 2009 at 10:12 PM, Masudamsd@gmail.com wrote: I'm trying to class array to another array. However Glove.class_name become

[Rails] Re: [Rails]Glove.class_name = 'Glofe'

2009-08-05 Thread Maurício Linhares
Ops, i meant Glove.name - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Aug 5, 2009 at 11:06 PM, Masudamsd@gmail.com wrote: Thanks for youre reply but ... Glove.class.name returns Class, not a class name. 2009/8/6 Maurício Linhares

[Rails] Re: Can I turn off config.action_view.cache_template_loading in Production

2009-07-30 Thread Maurício Linhares
Do you understand the performance hit you'll get once you do that? - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Jul 30, 2009 at 12:26 PM, jebwjebwilk...@gmail.com wrote: I've got an app which users can edit the ERB templates for emails

[Rails] Re: Scalability problem

2009-07-27 Thread Maurício Linhares
system they wrote in Ruby to control the application backend and this is the part of their infrastructure that got replaced by a Scala equivalent. High end messaging systems in Ruby are still years away from the ones you can find in Java. - Maurício Linhares http://codeshooter.wordpress.com/ | http

[Rails] Re: Where does RoR store cache_classes code?

2009-07-23 Thread Maurício Linhares
effects. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Jul 23, 2009 at 11:37 AM, sultansultan.bha...@gmail.com wrote: Fred, thanks for responding. What I meant was, where is the cache directory/file physically so I can delete

[Rails] Re: Hash Problem .. + Urgent

2009-07-22 Thread Maurício Linhares
Hashes won't keep the insertion order in Ruby (or any other language, you'll usually have to use some kind of ordered hash). - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Jul 22, 2009 at 9:23 AM, Hemant Bhargavarails-mailing-l...@andreas-s.net

[Rails] Re: Hash Problem .. + Urgent

2009-07-22 Thread Maurício Linhares
http://loopkid.net/articles/2008/06/19/ordered-hashes-in-ruby-1-8 - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Jul 22, 2009 at 9:29 AM, Hemant Bhargavarails-mailing-l...@andreas-s.net wrote: But i remember i had done it in Perl .. So y

[Rails] Re: rerouting between controller's actions *WITHOUT REDIRECT_TO*

2009-07-08 Thread Maurício Linhares
Well, that's isn't something easy to get going :) What you need to do is remove this permalink controller and implement the urls using permalinks for each model/controller pair that requires them. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed

[Rails] Re: problem with acts_as_versioned

2009-07-03 Thread Maurício Linhares
The name of the class is ActiveSupport::Inflector now, you'll have to change the reference on the plugin. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Jul 3, 2009 at 9:45 AM, Rafael Roquerails-mailing-l...@andreas-s.net wrote: Hi all, I get

[Rails] Re: problem with acts_as_versioned

2009-07-03 Thread Maurício Linhares
Get inside the plugin code, look for where Inflector is being used and change it to ActiveSupport::Inflector. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Jul 3, 2009 at 9:54 AM, Rafael Roquerails-mailing-l...@andreas-s.net wrote: Maurício

[Rails] Re: Mongrel Malformed Request error - help!

2009-06-29 Thread Maurício Linhares
Mongrel doesn't support SSL, you'll have to disable this on dev mode. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Jun 29, 2009 at 12:32 PM, Adam Wilsonrails-mailing-l...@andreas-s.net wrote: I've just migrated my system over to a new macbook

[Rails] Re: Comments belonging to two different models

2009-06-26 Thread Maurício Linhares
What you really need is polymorphic associations. But you can also just get a plugin with the code already implemented - http://github.com/jackdempsey/acts_as_commentable/tree/master - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Jun 26, 2009

[Rails] Re: Why is map.root not calling action to set vars...?

2009-06-17 Thread Maurício Linhares
Have you deleted the index.html file under the public folder? - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Jun 17, 2009 at 10:53 AM, gberz3gbe...@gmail.com wrote: Hi All, I've got a small problem with map.root in the following code

[Rails] Re: How to improve a plugin?

2009-06-16 Thread Maurício Linhares
You should use class_eval and instance_eval to do it, not redefining the class - http://codeshooter.wordpress.com/2009/06/04/understanding-class_eval-module_eval-and-instance_eval/ - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 16, 2009 at 6

[Rails] Re: How to improve a plugin?

2009-06-16 Thread Maurício Linhares
Place at your inittializers folder. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 16, 2009 at 8:35 AM, Vojtozero0...@gmail.com wrote: Yes I got it. But assume we have a Rails project. I could group all those methods and save them

[Rails] Re: How to improve a plugin?

2009-06-16 Thread Maurício Linhares
Did you really read the link I posted? It surely doesn't look like you did. The correct way of doing it is: ActMethods.module_eval do include MyActMethods end - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 16, 2009 at 8:45 AM, Vojtozero0

[Rails] Re: How to improve a plugin?

2009-06-16 Thread Maurício Linhares
And what's the error? If it's working the other way, just go for it. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 16, 2009 at 9:11 AM, Vojtozero0...@gmail.com wrote: That's what I'm trying to tell - it doesn't work. When I wrote

[Rails] Re: WHY parent.collection.eql?(parent.collection) = false ????

2009-06-16 Thread Maurício Linhares
Do you know what eql? compares? Shoudn't you be using == instead? - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 16, 2009 at 10:53 AM, nico Itkinrails-mailing-l...@andreas-s.net wrote: HEllo In other word how to make the ruby eql? method

[Rails] Re: cap deploy with no password

2009-06-16 Thread Maurício Linhares
You'll have to setup your SSH keys to the server where the application is being deployed - http://pkeck.myweb.uga.edu/ssh/ - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 16, 2009 at 9:31 PM, Mike Csnib...@gmail.com wrote: Each time I use

[Rails] Re: cap deploy with no password

2009-06-16 Thread Maurício Linhares
Then you did something wrong :) Review whatever you did and do it again. You should also do the same from the machine where the code is being deployed to the machine where your source code repo lives, specially if you're using git and ssh. - Maurício Linhares http://codeshooter.wordpress.com

[Rails] Re: Partials views and instance variables go nil

2009-06-14 Thread Maurício Linhares
@usuarios is nil when you post the forms and there are validation errors (you're not reloading them a the create action), here's how to solve it: %=collection_select(:usuario, :id, Usuario.all, :id, :nome_completo)% - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com

[Rails] Re: Unable to make observe_field work

2009-06-14 Thread Maurício Linhares
The: %= javascript_include_tag :defaults % Should appear BEFORE the: %= observe_field :friend, :url = friendships_url, :on = :click % It's usually placed at your page's header section. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sun, Jun 14

[Rails] Re: What is a simple way to increment the next record (not the id column)

2009-06-13 Thread Maurício Linhares
= :user_id protected def set_post_number write_attribute(:post_number, Post.count( :conditions = { :user_id = self.user_id } ) + 1 ) end end - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sat, Jun 13, 2009 at 5:36 AM, Chrischrisn

[Rails] Re: Rake migration error

2009-06-13 Thread Maurício Linhares
Look for where this PKG_NAME constant is being used and why it isn't initialized. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Jun 12, 2009 at 11:11 PM, dtoljdej...@gmail.com wrote: Hi, I am constantly getting an error when I use the rake

[Rails] Re: Please enlighten me and break me out of my shell

2009-06-13 Thread Maurício Linhares
Your ActiveRecord models have nothing to do with the application controller, you can't define a named_scope on it either. Named scopes can only be defined at ActiveRecord objects. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sat, Jun 13, 2009 at 10

[Rails] Re: Please enlighten me and break me out of my shell

2009-06-13 Thread Maurício Linhares
This whole sort_by thing isn't really nice, bad naming and an even worse condition, here's how you can avoid this if and even improve the method name that says nothing about what's being searched. http://gist.github.com/129084 - Maurício Linhares http://codeshooter.wordpress.com/ | http

[Rails] Re: Using find results the DNY way

2009-06-13 Thread Maurício Linhares
def configure @project = Project.find( params[:id], :include = { :floors = :rooms } ) @floors = @project.floors @rooms = @froors.map { |f| f.rooms }.flatten end - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sat, Jun 13, 2009

[Rails] Re: Using find results the DNY way

2009-06-13 Thread Maurício Linhares
furniture in one of the rooms. Is is as simple as adding @furniture = @rooms.map { |r| r.furniture }.flatten ? Can I keep on descending this way? Yep. But you should read more about active_record associations and eager loading. - Maurício Linhares http://codeshooter.wordpress.com/ | http

[Rails] Re: Please enlighten me and break me out of my shell

2009-06-13 Thread Maurício Linhares
That's probably 'cos you're setting the per_page parameter to nil in your controller. And please remove this fetch param. it's useless, use only the per_page parameter for that. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sat, Jun 13, 2009 at 11

[Rails] Re: How Can I insert another column data into the CSV file when I use FasterCSV?

2009-06-13 Thread Maurício Linhares
Have you looked at the FasterCSV docs? http://fastercsv.rubyforge.org/classes/FasterCSV.html Just parse the file and then write to it again with the new column. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sat, Jun 13, 2009 at 1:07 PM, Wesley

[Rails] Re: Removing routes to new, show, etc. in a model

2009-06-13 Thread Maurício Linhares
guarantee that there's someone on the other side to receive it. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sat, Jun 13, 2009 at 6:50 PM, Älphä Blüërails-mailing-l...@andreas-s.net wrote: I believe the easiest way I could find was: map.connect

[Rails] Re: Removing routes to new, show, etc. in a model

2009-06-13 Thread Maurício Linhares
On Sat, Jun 13, 2009 at 7:05 PM, Älphä Blüërails-mailing-l...@andreas-s.net wrote: Maurício Linhares wrote: Yes, this is very bad, if there's no edit, update or destroy in your controller Rails will just send a 404 back to the browser, it won't do anything like letting your user do something

[Rails] Re: Rails I18n

2009-06-13 Thread Maurício Linhares
Why don't you just do a simple form that does a GET to the same page with the locale as a parameter? - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sat, Jun 13, 2009 at 10:49 PM, Youyou Semsemrails-mailing-l...@andreas-s.net wrote: Hi, I am trying

[Rails] Re: How Can I insert another column data into the CSV file when I use FasterCSV?

2009-06-13 Thread Maurício Linhares
I said open the file, parse it again and re-generate it with the new column: FasterCSV.open(path/to/file.csv, w) do |csv| FasterCSV.foreach(path/to/new/file.csv) do |row| csv (row.fields + [ new_column_value ]) end end - Maurício Linhares http://codeshooter.wordpress.com

[Rails] Re: Just get the errortext, nothing more.

2009-06-12 Thread Maurício Linhares
You can just override it at your helpers and change this behaviour. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Jun 12, 2009 at 4:12 AM, mow...@googlemail.commow...@googlemail.com wrote: hey people i just wanna have the errortext

[Rails] Re: Sessions in Rails 2.3?

2009-06-12 Thread Maurício Linhares
Yes, you can't have a lot of objects in the session using the cookie based session store, but this shouldn't be a problem if you're just storing things like the flash or user ids on it. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Fri, Jun 12, 2009

[Rails] Re: Sqlite crazy timezone

2009-06-12 Thread Maurício Linhares
You don't fix that, Rails store the dates using the UTC timezone so it can show it in ANY other timezone in the views, active record will automatically change all dates to your current timezone when showing them in the view. - Maurício Linhares http://codeshooter.wordpress.com/ | http

[Rails] Re: Please enlighten me and break me out of my shell

2009-06-12 Thread Maurício Linhares
- Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Sat, Jun 13, 2009 at 12:21 AM, Älphä Blüërails-mailing-l...@andreas-s.net wrote: Marnen, good advice. Something like this:  def self.do_sort(sort_by, search, page)    start_date

[Rails] Re: Parsing big XML files - memory issue

2009-06-11 Thread Maurício Linhares
/sax-machine-sax-parsing-made-easy.html As to my problem, I wrote a StAX based parser using Java to get it to run in reasonable time :( - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Jun 11, 2009 at 5:41 AM, PierreWwamre...@googlemail.com wrote

[Rails] Re: CPU Time - ActiveRecord

2009-06-11 Thread Maurício Linhares
I guess you won't get any answers with this question. Can't you explain your problem a little bit better? - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Jun 11, 2009 at 1:13 PM, Brunobruno@gmail.com wrote: HI, How i get CPUTime

[Rails] Re: Sessions in Rails 2.3?

2009-06-11 Thread Maurício Linhares
Currently Rails stores sessions in the browser and this is the most scalable solution found until now. Unless you have a really great idea to build a better session store, just use the cookie based one and you're done. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com

[Rails] Re: Module: ActionView::Helpers::DateHelper

2009-06-11 Thread Maurício Linhares
Aren't you using any kind of date_select plugin? - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Jun 11, 2009 at 4:42 AM, Nike Mikerails-mailing-l...@andreas-s.net wrote: hi i am using date_select helper for displaying month day and year.I am

[Rails] Re: Overrite ActiveRecord Methods in Plugin

2009-06-11 Thread Maurício Linhares
self.update_attributes_without_acts_as_loggable( attributes ) puts after update attributes end end end - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Jun 11, 2009 at 7:05 PM, Helena Wotringrails-mailing-l...@andreas-s.net wrote: I'm trying to write

[Rails] Re: distributed models

2009-06-11 Thread Maurício Linhares
are the implications of this type of distributed design? - Relevant design patterns. You'll find a discussion and many patterns related to this at Patterns of Enterprise Application Architeture and Domain Driven Design books. - Maurício Linhares http://codeshooter.wordpress.com/ | http

[Rails] Re: uninitialized constant ActiveSupport::Cache (NameError)

2009-06-10 Thread Maurício Linhares
Wow, you have thousands of versions of the same libraries, why don't you start by deleting them? gem clean Should do it. Maybe you're getting a conflict of old gems trying to access new rails code. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed

[Rails] Re: uninitialized constant ActiveSupport::Cache (NameError)

2009-06-10 Thread Maurício Linhares
Show the full backtrace of the error. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Jun 10, 2009 at 12:33 PM, jan.javi...@gmail.com wrote: Thanks for the suggestion, but I was anxious cleaning all of them as I use some old projects

[Rails] Re: Compare timestamps

2009-06-10 Thread Maurício Linhares
Person.all( :conditions = [ 'created_at BETWEEN ? AND ?', Time.now.at_beginning_of_day, Time.now.at_beginning_of_day + 1.day ] ) - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Jun 10, 2009 at 3:46 PM, Bruno Sousarails-mailing-l...@andreas-s.net

[Rails] Re: Current User, Database etc ..

2009-06-09 Thread Maurício Linhares
YourActiveRecordModel.configurations[ Rails.env ][ 'username' ] YourActiveRecordModel.configurations[ Rails.env ][ 'database' ] - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 9, 2009 at 11:14 AM, Steve Dcrails-mailing-l...@andreas-s.net wrote

[Rails] Re: Current User, Database etc ..

2009-06-09 Thread Maurício Linhares
This is how you can get the info from an activerecord object, if you're not using active record or if you're using a custom made solution it obviously won't work. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 9, 2009 at 12:26 PM, Steve

[Rails] Re: Getting my feet wet on Linux - some questions

2009-06-09 Thread Maurício Linhares
by default, you usually don't need to take improved security measures beyond not installing software that you're not going to use, updating all software as soon as possible and using long and hard to guess passwords. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr

[Rails] Re: Getting my feet wet on Linux - some questions

2009-06-09 Thread Maurício Linhares
Here's a list of changes between versions - http://eigenclass.org/hiki/Changes+in+Ruby+1.9 - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Tue, Jun 9, 2009 at 2:48 PM, Älphä Blüërails-mailing-l...@andreas-s.net wrote: Thanks guys.. I'm going

[Rails] Re: Rails Hosting Questions

2009-06-09 Thread Maurício Linhares
. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Wed, Jun 10, 2009 at 12:09 AM, Älphä Blüërails-mailing-l...@andreas-s.net wrote: Well, if anyone manages to read this: Nightmare #1:  Always ask the hosting provider (before signing up on a VPS) exactly

[Rails] Re: Deployment Question

2009-06-08 Thread Maurício Linhares
Tomcat (but I woudn't recommend using the later). Look that we're not talking about hosting just one application (which was Janna's problem at the beginning and to which I said that using the Glassfish gem would do it nicely) but hosting many applications at the same time. - Maurício Linhares http

[Rails] Re: Deployment Question

2009-06-08 Thread Maurício Linhares
Tomcat is famous for it's memory leaks and classloading issues, not really sure if they have improved it in anyway in this 6 version, but Tomcat 5 was a pain to get working specially if you used any of the Jakarta Commons libraries in your application. - Maurício Linhares http

[Rails] Re: Deployment Question

2009-06-08 Thread Maurício Linhares
. But this isn't really a discussion for a ROR list ;) And I'd go for Jetty anyway - http://jetty.mortbay.com/ - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Jun 8, 2009 at 4:04 PM, Hassan Schroederhassan.schroe...@gmail.com wrote: 2009/6/8

[Rails] Re: NameError what is it?

2009-06-08 Thread Maurício Linhares
Either change your filename to app/controllers/process_jobs_controller.rb or make the J on job lowercase. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Jun 8, 2009 at 11:40 PM, Steve Dcrails-mailing-l...@andreas-s.net wrote: I have

[Rails] Re: why do restful_authentication generated rspec tests fail?

2009-06-07 Thread Maurício Linhares
. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Sun, Jun 7, 2009 at 1:51 PM, Jonathanwyscr...@gmail.com wrote: Been searching online for an answer to this without success - also been digging through the documentation but I'm still very

[Rails] Re: link_to from controller

2009-06-07 Thread Maurício Linhares
You can't and shouldn't be doing this inside a controller. Just do it in the view. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Mon, Jun 8, 2009 at 12:01 AM, Valen Onishrails-mailing-l...@andreas-s.net wrote: I need to use 'link_to

[Rails] Re: Deployment Question

2009-06-07 Thread Maurício Linhares
and the application should be available at http://localhost:8080/war_file_name;. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Sun, Jun 7, 2009 at 7:16 PM, Vivek Pandeyvivek.pan...@gmail.com wrote: To host multiple applications, on the same server, you

[Rails] Building an I18N aware custom form builder on Rails

2009-06-06 Thread Maurício Linhares
Hi, I just wrote a simple tutorial about custom form builders that uses the Rails I18N support to generate labels, any feedback is appreciated - http://codeshooter.wordpress.com/2009/06/06/building-a-i18n-aware-form-builder-for-your-rails-applications/ - Maurício Linhares http

[Rails] Re: Abbreviated stack when using runner

2009-06-06 Thread Maurício Linhares
. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying do debug a problem that might steem from framework code. Rails.backtrace_cleaner.remove_silencers! You'll get all backtraces again. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http

[Rails] Re: Rake Tasks

2009-06-06 Thread Maurício Linhares
it. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails

[Rails] Re: ActiveRecord test problem

2009-06-05 Thread Maurício Linhares
ActiveRecord tests will only work with JRuby for ActiveRecord 2.3. And while you're at it, upgrade your JRuby install to 1.3. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Fri, Jun 5, 2009 at 4:38 AM, Francesca Tartrails-mailing-l

[Rails] Re: Deployment Question

2009-06-05 Thread Maurício Linhares
. And about NIO, it's better if you look by yourself, you can start at the Grizzly connector homepage - https://grizzly.dev.java.net/ - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Fri, Jun 5, 2009 at 10:13 AM, JannaBmistressja...@hotmail.com wrote

[Rails] Re: Deployment Question

2009-06-05 Thread Maurício Linhares
see the expressioni config.threadsafe! in either config/environment.rb or config/environments/production.rb Can you show me, exactly what I need to put where, to accomplish this? Thanks, Janna B On Jun 5, 9:18 am, Maurício Linhares mauricio.linha...@gmail.com wrote: If you're using the latest

[Rails] Re: Slow/unpredictive response of post_form from rails lib

2009-06-05 Thread Maurício Linhares
A timeout from time to time isn't something to worry about, in your library you can just add a retry clause and retry a specific number of times (maybe 2) before raising the exception to the calling code. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http

[Rails] Re: namespaced application layout?

2009-06-05 Thread Maurício Linhares
Create a basic admin controller, like this: class Admin::BaseController ApplicationController layout :admin end Then make all admin controllers inherit from it. And also create an layouts/admin.html.erb file ;) - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http

[Rails] Re: Mongrel not playing nicely with older rails/ruby

2009-06-05 Thread Maurício Linhares
Looks like what you need is a newer version of Rubygems and not ruby or mongrel. You can get the latest one here - http://rubyforge.org/frs/?group_id=126 - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Fri, Jun 5, 2009 at 4:30 PM

[Rails] Re: Scaffolding question

2009-06-05 Thread Maurício Linhares
The integer, string and float methods are just shorthands for the column call using that type. It's also the new way (new since Rails 2, not that new now) of writing migrations. And the timestamps will create both a created_at and also an updated_at column. - Maurício Linhares http

[Rails] Re: creating migrations

2009-06-05 Thread Maurício Linhares
Configure this legacy database in your database.yml file and then: rake db:schema:dump The schema.rb file will contain the legacy database structure. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Fri, Jun 5, 2009 at 11:25 PM

[Rails] Re: Scaffolding question

2009-06-05 Thread Maurício Linhares
you have shown should be placed into a class in your application and be called on this rake task. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Sat, Jun 6, 2009 at 12:38 AM, J. D.rails-mailing-l...@andreas-s.net wrote: Maurício

[Rails] Re: Scaffolding question

2009-06-05 Thread Maurício Linhares
That's not really related to the rake task, it's a cron config (i'm guessing that you're on Linux or some kind of OS that has the cron utility). You can google about cron and config it the way you want. Then cron will call your rake task as needed. - Maurício Linhares http

[Rails] Re: Deployment Question

2009-06-04 Thread Maurício Linhares
On Windows? Try JRuby, simplest way to get it working and you won't even have troubles with native gems. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Thu, Jun 4, 2009 at 6:16 PM, JannaB mistressja...@hotmail.com wrote: Passenger

[Rails] Re: Deployment Question

2009-06-04 Thread Maurício Linhares
Who said you need warbler or a war file? Have you searched for the glassfish gem or jetty-rails? You'll be amazed how it's easier than dabbling in Apache config, specially on Windows. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Thu, Jun 4

[Rails] Re: Deployment Question

2009-06-04 Thread Maurício Linhares
Have you tried the Glassfish gem before writing so much nonsense? http://glassfishgem.rubyforge.org/ You could at least read what people are saying before answering. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Thu, Jun 4, 2009 at 9:29 PM

[Rails] Re: Deployment Question

2009-06-04 Thread Maurício Linhares
it. In Java parlance it's simple servlet container. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Thu, Jun 4, 2009 at 10:56 PM, JannaB mistressja...@hotmail.com wrote: This is cool. No repackaging -- and if I am correct, when running in glassfish

[Rails] Re: Deployment Question

2009-06-04 Thread Maurício Linhares
Exactly :) And you call it just like you'd call a mongrel server. Easiest way to get up and running with Ruby on Windows if you don't want to struggle with native gems and natural Ruby slowness on Windows. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com

[Rails] Re: Deployment Question

2009-06-04 Thread Maurício Linhares
The Grizzly connector is a pure Java NIO (means non-blocking) HTTP connector. It's faster, more reliable and still under development, while mongrel doesn't look very active at the moment. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Thu, Jun

[Rails] Re: Form validation on non-CRUD activities

2009-06-01 Thread Maurício Linhares
Here's what i use - http://github.com/staugaard/active_record_base_without_table/tree/master - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Mon, Jun 1, 2009 at 5:20 AM, Tom R asubstit...@gmail.com wrote: Hi there, I'm relativity new

[Rails] Re: override finders?

2009-06-01 Thread Maurício Linhares
http://ryandaigle.com/articles/2008/11/18/what-s-new-in-edge-rails-default-scoping - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Mon, Jun 1, 2009 at 2:42 PM, Michal Burak rails-mailing-l...@andreas-s.net wrote: Hi, 1. I have my model

  1   2   3   4   >