Active Record is a pattern that combines domain logic with storage abstraction in single object.
I want to make a migration in Rails, referencing another table. Usually, I would do something like: add_column :post, :…
ruby-on-rails ruby-on-rails-3 activerecord rails-migrationsIs there a rails-way way to validate that an actual record is unique and not just a column? For example, …
ruby-on-rails ruby-on-rails-3 validation activerecord rails-activerecordI have this code User.find(:all, :limit => 10, :joins => :user_points, :select => "users.*, count(user_points.id)", :…
ruby-on-rails activerecord join left-join inner-joinI'm writing a rake task that does some DB work outside of Rails/ActiveRecord. Is there a way to get …
ruby-on-rails ruby database activerecord environmentI can't seem to find a definitive answer on this and I want to make sure I understand this to …
ruby activerecord size content-lengthHow can I sort an array returned by an ActiveRecord query by a created_at date column? This occurs once …
ruby-on-rails ruby arrays activerecordWhen I run queries (e.g. MyModel.where(...) or record.associated_things) in the console, how can I see the …
ruby-on-rails activerecordThis follows this prior question, which was answered. I actually discovered I could remove a join from that query, so …
ruby-on-rails ruby activerecord join associationsI'm doing this: $students = Student::find()->all(); return $this->render('process', array('students' => $students)); and then …
php sql activerecord logging yii2So, I've found several examples for finding a random record in Rails 2 -- the preferred method seems to be: Thing.…
ruby-on-rails ruby ruby-on-rails-3 activerecord random