Top "Activerecord" questions

Active Record is a pattern that combines domain logic with storage abstraction in single object.

How to drop columns using Rails migration

What's the syntax for dropping a database table column through a Rails migration?

ruby-on-rails ruby database activerecord rails-migrations
How to add an ORDER BY clause using CodeIgniter's Active Record methods?

I have a very small script to get all records from a database table, the code is below. $query = $this-&…

php codeigniter select activerecord sql-order-by
Codeigniter: does $this->db->last_query(); execute a query?

Does query execution happen at the get_where() clause of the following codeigniter active record statement? $this->db->…

codeigniter activerecord codeigniter-2
Rails: select unique values from a column

I already have a working solution, but I would really like to know why this doesn't work: ratings = Model.select(:…

ruby-on-rails activerecord
Rails: How do I create a default value for attributes in Rails activerecord's model?

I want to create a default value for an attribute by defining it in ActiveRecord. By default everytime the record …

ruby-on-rails activerecord
CodeIgniter Active Record - Get number of returned rows

I'm very new to CodeIgniter and Active Record in particular, I know how to do this well in normal SQL …

activerecord codeigniter
How do you manually execute SQL commands in Ruby On Rails using NuoDB

I'm trying to manually execute SQL commands so I can access procedures in NuoDB. I'm using Ruby on Rails and …

sql ruby-on-rails-3 activerecord nuodb
Rails Active Record find(:all, :order => ) issue

I seem to be unable to use the ActiveRecord::Base.find option :order for more than one column at a …

ruby-on-rails ruby activerecord
Getting data posted in between two dates

How can I retrieve data from the database by querying records between two dates using CodeIgniter's activerecord?

php sql codeigniter activerecord
How to get last N records with activerecord?

With :limit in query, I will get first N records. What is the easiest way to get last N records?

ruby-on-rails ruby activerecord