[Rails] Initializers - Metaprogramming (uninitialized constant Net (NameError)

2011-05-02 Thread Erico Fusco
Hi guys, I´m trying to change a SMTP method on my rails application creating a file on initializers folder, but I'm getting this error: uninitialized constant Net (NameError) I don't know if I'm doing this right, here it's my .rb file I put on initializers folder. initializers/test.rb Net::SMTP.

[Rails] Re: undefined method error because I am not understanding Rails initializers

2011-04-25 Thread John Merlino
I restarted the server and it appears to have worked. -- Posted via http://www.ruby-forum.com/. -- 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-talk@googlegroups.com. To unsubscribe from

[Rails] undefined method error because I am not understanding Rails initializers

2011-04-25 Thread John Merlino
Hey all, In app/builders, I have a file called table_builder.rb. In the constructor method of my TableBuilder class, I call an instance method called assign_attributes which takes a hash and converts the key/value pairs into instance methods. The assign_attributes method is declared in the follow

[Rails] Initializers from Rails 2 to Rails 3

2010-08-15 Thread Bharat Ruparel
I am upgrading an app from Rails 2.3.8 to Rails 3.0. I am finding that the initializers in the initializers directory do not seem to load. Is there any way to configure it. In general, what are the new load procedures for Rails 3? Thanks. Bharat -- Posted via http://www.ruby-forum.com/. -- Yo

[Rails] initializers

2010-01-23 Thread Craig White
Have a bit of a conundrum that I need to solve I would like to put this into environment.rb... config.action_mailer.default_url_options = { :host => Setting[:website_url] } but it obviously can't read from the database before it is initialized and the configuration for action_mailer 'options' ap

[Rails] initializers

2009-08-05 Thread Allen Walker
I created a "config/initializers/tasks.rb" In it I have the following is all: logger.info("Running tasks") However nothing is logged or run. Am I missing something? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message becaus

[Rails] Initializers and automatically running code

2009-06-22 Thread Alexander Trauzzi
I want to decorate ActiveRecord with a new method so that any classes that inherit from it also have the method. I've been told that initializers are the way to go, yet when I put a file in initializers containing: class << ActiveRecord::Base def methodName(params) end end The method do

[Rails] Initializers not available in controllers...

2009-04-07 Thread Neal L
Hi all, I have a file in config/initializers that specifies plan types. The file is: == APP_PLANS = [ { "id" => 0, "name" => 'free', "Price" => 0, "Users" => 1, "Storage"=> 0, "SSL"=> true }, { "id"

[Rails] Initializers and I18n

2009-03-19 Thread Daniel Lopes
Hello, My project have strange behavior diferent than I expected. If I place a line like below after the Rails::Initializer block from my enviroment file it will work fine: PROJECT_NAME = I18n.t("settings.name") But If I move this to a initializer file it will get the translation error: "tran