Top "Activerecord" questions

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

What does inverse_of do? What SQL does it generate?

I'm trying to get my head around inverse_of and I do not get it. What does the generated sql …

ruby-on-rails activerecord
Rails 5: ActiveRecord OR query

How 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-activerecord
find() with nil when there are no records

In my current rails program when I use something like user = User.find(10) When there is no user with ID=10 , …

ruby-on-rails ruby ruby-on-rails-3 activerecord
How to save a model without running callbacks in Rails

I 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
Rails 3 - select with Include?

Here is a nested select with include: @items = Item.where("complete = ?", true).includes( :manufacturer, {:order=>[:supplier, :agent] }) This is …

ruby-on-rails ruby-on-rails-3 activerecord select include
How do I replace accented Latin characters in Ruby?

I have an ActiveRecord model, Foo, which has a name field. I'd like users to be able to search by …

ruby-on-rails ruby activerecord unicode utf-8
How to do IS NULL and IS NOT NULL with Yii 2 ActiveRecord?

I have a table which has a field `activated_at` timestamp NULL DEFAULT NULL, which means that it can contain …

php activerecord yii yii2
varchar Migration question for Ruby on Rails

I have created a new table including a column "note". The default is varchar(255) I believe but I wish to …

ruby-on-rails activerecord migration rails-migrations
Codeigniter - handling errors when using active record

I am putting together a few models for my codeigniter site and can't seem to find any word in the …

php codeigniter activerecord
Update the value of a field in database by 1 using codeigniter

I want to implement a SQL statement using codeigniter active record. UPDATE tags SET usage = usage+1 WHERE tag="java"; How …

database activerecord codeigniter insert-update