Difference between Active Model, Active Record and Active Resource

Rails 3 is designed with modularity in mind. Each module has its own purpose and functionality. ActiveModel: This component was created in Rails 3. They took all the model related parts that did not have a database requirement of Rails 2 ActiveRecord and moved it into ActiveModel. So ActiveModel includes things like validations. More information: … Read more

Connecting Rails 3.1 with Multiple Databases

To Wukerplank’s answer, you can also put the connection details in database.yml like usual with a name like so: log_database_production: adapter: mysql host: other_host username: logmein password: supersecret database: logs Then in your special model: class AccessLog < ActiveRecord::Base establish_connection “log_database_#{Rails.env}”.to_sym end To keep those pesky credentials from being in your application code. Edit: If … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)