The implementation of object-relational mapping (ORM) using the Active Record pattern in the Ruby on Rails framework.
This has been bugging me for a while... How can I string interpolate a datetime in Rails ActiveRecord queries? # Works, …
ruby-on-rails activerecord rails-activerecordI'm implementing a user search feature in my Rails app. However, I don't want admins to appear in the search …
ruby-on-rails ruby activerecord rails-activerecordI've been debugging this strange problem of Rails giving me "Unknown primary key for table...", even when the table's ID …
ruby-on-rails postgresql heroku rails-activerecord heroku-postgresI have two models joined with a has_many :through relationship: class Publication < ActiveRecord::Base has_many :publication_contributors …
ruby-on-rails rails-activerecordA user has many uploads. I want to add a column to the uploads table that references the user. What …
rails-activerecord ruby-on-rails-5 rails-migrationsI'm trying to write a nested joins query with a condition. The query I have right now is: Event.joins(:…
sql ruby-on-rails rails-activerecordReferencing to Rails 4.2 add_foreign_key support: # add a foreign key to `articles.author_id` referencing `authors.id` add_foreign_…
ruby-on-rails ruby ruby-on-rails-4 rails-activerecord ruby-on-rails-4.2Is it possible to set up a double relationship in activerecord models via the generate scaffold command? For example, if …
ruby-on-rails rails-activerecord relationshipAssume I have this model: class Conversation < ActiveRecord::Base enum status: [ :active, :archived ] end How can I find all …
ruby-on-rails ruby ruby-on-rails-4 rails-activerecord ruby-on-rails-4.1I have model Profile. Profile has_one User. User model has field email. When I call Profile.some_scope.includes(:…
ruby-on-rails ruby-on-rails-3 rails-activerecord