The implementation of object-relational mapping (ORM) using the Active Record pattern in the Ruby on Rails framework.
I have some models that have after_save callbacks. Usually that's fine, but in some situations, like when creating development …
ruby-on-rails ruby rails-activerecordIn Rails, you can find the number of records using both Model.size and Model.count. If you're dealing with …
ruby-on-rails ruby ruby-on-rails-3 rails-activerecordSuppose I have the following two objects: first_name_relation = User.where(:first_name => 'Tobias') # ActiveRecord::Relation last_name_…
ruby-on-rails rails-activerecord arelI have 3 models: class Student < ActiveRecord::Base has_many :student_enrollments, dependent: :destroy has_many :courses, through: :student_enrollments …
sql ruby-on-rails ruby-on-rails-4 rails-activerecord mysql2I'm wondering how the following is done in Rails 4 or if I just use the Rails 3 approach for using a …
ruby-on-rails-4 scope rails-activerecordI'm in need of getting a random record from a table via ActiveRecord. I've followed the example from Jamis Buck …
ruby-on-rails random rails-activerecordI need to add timestamps (created_at & updated_at) to an existing table. I tried the following code but …
ruby-on-rails ruby rails-activerecord rails-migrationsPossible Duplicate: How can I avoid running ActiveRecord callbacks? I have model like this class Vote < ActiveRecord::Base after_…
ruby-on-rails rails-activerecordHow should I write the conditional statement for when I want to get all the records which were created today?
ruby-on-rails date rails-activerecordWhere can I find a list of data types that can be used in rails 3? (such as text, string, integer, …
ruby-on-rails ruby ruby-on-rails-3 rails-activerecord