The implementation of object-relational mapping (ORM) using the Active Record pattern in the Ruby on Rails framework.
I have a User model and a Task model. I have not mentioned any relation between them while creating them. …
ruby-on-rails rails-activerecord ruby-on-rails-4 rails-migrationsI have an ActiveRecord model that has a date attribute. Is it possible to utilize that date attribute to find …
ruby-on-rails ruby-on-rails-3 activerecord rails-activerecordAt the first migration, I declared on a column content to be string Activerecord made it to be string(255) according …
ruby-on-rails string postgresql ruby-on-rails-3.1 rails-activerecordRails has a has_one :through association that helps set up a one-to-one association with a third model by going …
ruby-on-rails associations rails-activerecord rails-modelsThe docs: http://guides.rubyonrails.org/active_record_querying.html#selecting-specific-fields Clearly state that: query = Client.select(:name).distinct # => …
ruby-on-rails rails-activerecordAt ShowNearby we have been doing a very big migration to RoR 3.1 from PHP and we are facing several problems …
ruby-on-rails ruby ruby-on-rails-3 rails-activerecord activeresourceI'm trying to overwrite a getter method for an ActiveRecord model. I have an attribute called name in the model …
ruby-on-rails ruby rails-activerecord getter-setterHow can I restrict a Rails validation to check only on create OR when the field isn't blank? I'm creating …
ruby-on-rails ruby rails-activerecordHow do you do an or query in Rails 5 ActiveRecord? Also, is it possible to chain or with where in …
ruby-on-rails ruby activerecord ruby-on-rails-5 rails-activerecordI need to calculate values when saving a model in Rails. So I call calculate_averages as a callback for …
ruby-on-rails ruby-on-rails-3 activerecord ruby-on-rails-3.2 rails-activerecord