Gang Of Coders
Home
About Us
Contact Us
All Activerecord Solutions on Gang of Coders
Total of 179 Activerecord Solutions
How to use ActiveRecord in a ruby script outside Rails?
Ruby on-Rails
Ruby
Activerecord
Scripting
ActiveRecord serialize using JSON instead of YAML
Ruby on-Rails
Json
Activerecord
Yaml
Serialization
Create seed file from data already in the database
Ruby on-Rails
Activerecord
Ruby on-Rails-3
Rake
Rails: Force empty string to NULL in the database
Mysql
Ruby on-Rails
Activerecord
Ruby on-Rails-3.1
How to specify conditions on joined tables in rails
Sql
Ruby on-Rails
Activerecord
Rails: uniq vs. distinct
Ruby on-Rails
Activerecord
rails override default getter for a relationship (belongs_to)
Ruby on-Rails
Activerecord
Associations
Default Value
How to get activerecord associations via reflection
Ruby
Reflection
Activerecord
How to update all when you need callbacks fired?
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Callback
Update All
Model.reset_column_information does not reload columns in rails migration
Ruby on-Rails
Activerecord
Migration
Rake
Ruby on-Rails-3.2
Create an ActiveRecord database table with no :id column?
Mysql
Ruby on-Rails
Ruby
Security
Activerecord
dependent => destroy on a "has_many through" association
Ruby on-Rails
Activerecord
Has Many-Through
How do I get ActiveRecord to show the next id (last + 1) in Ruby on Rails?
Ruby on-Rails
Activerecord
Rails belongs_to many models
Ruby on-Rails
Activerecord
Belongs To
ActiveRecord Rails 3 scope vs class method
Ruby on-Rails-3
Activerecord
Class Method
Scopes
Log the actual SQL query using ActiveRecord with Yii2?
Php
Sql
Activerecord
Logging
Yii2
Multiple databases in Rails
Ruby on-Rails
Database
Activerecord
Rails Object Relationships and JSON Rendering
Ruby on-Rails
Ruby
Json
Activerecord
What's the difference between “includes” and “preload” in an ActiveRecord query?
Ruby on-Rails
Ruby
Activerecord
Rails 4: find all records
Activerecord
Ruby on-Rails-4
Yii2 How to perform where AND or OR condition grouping?
Php
Mysql
Activerecord
Yii
Yii2
ActiveRecord - querying polymorphic associations
Ruby on-Rails
Ruby
Activerecord
Polymorphic Associations
Rails ActiveRecord: How do I know if find_or_create_by found or created?
Ruby on-Rails
Activerecord
can you use activerecord to find substring of a field? (quick & dirty keyword finder)
Ruby on-Rails
Activerecord
Why isn't self always needed in ruby / rails / activerecord?
Ruby
Ruby on-Rails-3
Activerecord
Self
Rails: has_many through with polymorphic association - will this work?
Ruby on-Rails
Activerecord
Has Many-Through
Polymorphic Associations
Rails - Delete all Records that Meet a Condition
Sql
Ruby on-Rails
Activerecord
pluralize without count number in rails 4
Ruby on-Rails
Ruby on-Rails-4
Activerecord
Pluralize
Rails: correct way of turning activerecord relation to array?
Ruby on-Rails
Ruby
Activerecord
How to return an empty ActiveRecord relation?
Ruby on-Rails
Activerecord
Relation
Rails: select unique values from a column
Ruby on-Rails
Activerecord
Do rails rake tasks provide access to ActiveRecord models?
Ruby on-Rails
Activerecord
Rake
Task
Determine if ActiveRecord Object is New
Ruby on-Rails
Activerecord
Case-insensitive search in Rails model
Ruby on-Rails
Activerecord
Case Insensitive
Is there a way to get a collection of all the Models in your Rails app?
Ruby on-Rails
Activerecord
Collections
Model
delete_all vs destroy_all?
Ruby on-Rails
Ruby
Database
Activerecord
What is causing this ActiveRecord::ReadOnlyRecord error?
Ruby on-Rails
Ruby
Activerecord
Join
Associations
Rails find_or_create_by more than one attribute?
Ruby on-Rails
Activerecord
Model
Many to-Many
Dynamic Attributes
Rails: How do I create a default value for attributes in Rails activerecord's model?
Ruby on-Rails
Activerecord
Validate uniqueness of multiple columns
Ruby on-Rails
Ruby on-Rails-3
Validation
Activerecord
Rails Activerecord
Rails: Using greater than/less than with a where statement
Ruby on-Rails
Activerecord
Rails Activerecord
How to get last N records with activerecord?
Ruby on-Rails
Ruby
Activerecord
How do you manually execute SQL commands in Ruby On Rails using NuoDB
Sql
Ruby on-Rails-3
Activerecord
Nuodb
What's the difference between belongs_to and has_one?
Ruby on-Rails
Activerecord
Rails: validate uniqueness of two columns (together)
Ruby on-Rails
Ruby on-Rails-3
Ruby on-Rails-4
Activerecord
Rails Activerecord
What does inverse_of do? What SQL does it generate?
Ruby on-Rails
Activerecord
How do you discover model attributes in Rails?
Ruby on-Rails
Activerecord
belongs_to through associations
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Rails 3 migrations: Adding reference column?
Ruby on-Rails
Activerecord
Migration
Can you get DB username, pw, database name in Rails?
Ruby on-Rails
Ruby
Database
Activerecord
Environment
How to chain scope queries with OR instead of AND?
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Rails Activerecord
Override ActiveRecord attribute methods
Ruby on-Rails
Oop
Activerecord
How to select where ID in Array Rails ActiveRecord without exception
Ruby on-Rails
Activerecord
Find
How to drop columns using Rails migration
Ruby on-Rails
Ruby
Database
Activerecord
Rails Migrations
Count, size, length...too many choices in Ruby?
Ruby
Activerecord
Size
Content Length
How to show SQL queries run in the Rails console?
Ruby on-Rails
Activerecord
Specifying column name in a "references" migration
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Rails Migrations
When to use a "has_many :through" relation in Rails?
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Ruby on Rails. How do I use the Active Record .build method in a :belongs to relationship?
Ruby on-Rails
Activerecord
Foreign Keys
Using Rails serialize to save hash to database
Ruby on-Rails
Ruby
Serialization
Activerecord
When to add what indexes in a table in Rails
Mysql
Ruby on-Rails
Activerecord
How to convert ActiveRecord results into an array of hashes
Arrays
Activerecord
Hash
Rails 3: Get Random Record
Ruby on-Rails
Ruby
Ruby on-Rails-3
Activerecord
Random
Rails 4 LIKE query - ActiveRecord adds quotes
Sql
Ruby on-Rails
Ruby
Postgresql
Activerecord
How to list of all the tables defined for the database when using active record?
Activerecord
How can I see the SQL that will be generated by a given ActiveRecord query in Ruby on Rails
Sql
Ruby on-Rails
Activerecord
Rails: Why does find(id) raise an exception in rails?
Ruby on-Rails
Activerecord
ActiveRecord: List columns in table from console
Sql
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Can you do greater than comparison on a date in a Rails 3 search?
Ruby on-Rails
Activerecord
Ruby on-Rails-3
How to do a LIKE query in Arel and Rails?
Ruby on-Rails
Activerecord
Arel
Eager load polymorphic
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Find all records which have a count of an association greater than zero
Sql
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Find rows with multiple duplicate fields with Active Record, Rails & Postgres
Ruby on-Rails
Postgresql
Activerecord
ActiveRecord, has_many :through, and Polymorphic Associations
Ruby on-Rails
Activerecord
Polymorphic Associations
Converting an array of objects to ActiveRecord::Relation
Ruby on-Rails
Ruby
Activerecord
find() with nil when there are no records
Ruby on-Rails
Ruby
Ruby on-Rails-3
Activerecord
Rails 5: ActiveRecord OR query
Ruby on-Rails
Ruby
Activerecord
Ruby on-Rails-5
Rails Activerecord
Using helpers in model: how do I include helper dependencies?
Ruby on-Rails
Ruby
Activerecord
Model
How to implement a unique index on two columns in rails
Ruby on-Rails
Activerecord
How to execute a raw update sql with dynamic binding in rails
Ruby on-Rails
Activerecord
Rawsql
Rails - Validate Presence Of Association?
Ruby on-Rails
Ruby on-Rails-3
Validation
Activerecord
How to determine if a record is just created or updated in after_save
Ruby on-Rails
Activerecord
Activemodel
Rails create or update magic?
Ruby on-Rails
Activerecord
Overriding id on create in ActiveRecord
Ruby on-Rails
Activerecord
ActiveRecord.find(array_of_ids), preserving order
Ruby on-Rails
Ruby
Activerecord
How does Rails keep track of which migrations have run for a database?
Ruby on-Rails
Activerecord
Saving multiple objects in a single call in rails
Ruby on-Rails
Activerecord
Data Access
In rails, how can I find out what caused a .save() to fail, other than validation errors?
Ruby on-Rails
Activerecord
Rails filtering array of objects by attribute value
Ruby on-Rails
Activerecord
Why all the Active Record hate?
Ruby on-Rails
Design Patterns
Oop
Activerecord
How do I turn on SQL debug logging for ActiveRecord in RSpec tests?
Ruby on-Rails
Ruby
Activerecord
Rspec Rails
how to add records to has_many :through association in rails
Ruby on-Rails
Activerecord
Has Many-Through
Rails find record with zero has_many records associated
Sql
Ruby on-Rails
Activerecord
Has Many
ActiveRecord Query Union
Ruby on-Rails
Activerecord
Union
Active Relation
Safe ActiveRecord like query
Ruby
Activerecord
Ruby on-Rails-4
How to get the original value of an attribute in Rails
Ruby on-Rails
Activerecord
Check if record exists from controller in Rails
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Exists
Rails: Order with nulls last
Ruby on-Rails
Ruby on-Rails-3
Sorting
Activerecord
Null
validation custom message for rails 3
Ruby on-Rails
Ruby
Ruby on-Rails-3
Validation
Activerecord
How to implement has_many :through relationships with Mongoid and mongodb?
Ruby on-Rails
Activerecord
Mongodb
Data Modeling
Mongoid
Active Record - Find records which were created_at before today
Ruby
Activerecord
Deprecation warning when using has_many :through :uniq in Rails 4
Ruby on-Rails
Activerecord
Rails Activerecord
Ruby on-Rails-4
Get only records created today in laravel
Mysql
Date
Activerecord
Where
Laravel 5.1
Check if record was just destroyed in rails
Ruby on-Rails
Ruby
Activerecord
Use a scope by default on a Rails has_many relationship
Ruby on-Rails-3
Activerecord
Has Many
Using ActiveRecord, is there a way to get the old values of a record during after_update
Ruby on-Rails
Activerecord
Model
Callback
What exactly is Arel in Rails 3.0?
Ruby on-Rails
Ruby
Activerecord
Arel
LEFT OUTER joins in Rails 3
Ruby on-Rails
Ruby
Activerecord
Update one column to value of another in Rails migration
Ruby on-Rails
Activerecord
Migration
Timestamp
Best practice about empty belongs_to association
Ruby on-Rails
Ruby
Activerecord
Regular expressions with validations in RoR 4
Ruby on-Rails
Ruby
Activerecord
"Order by" result of "group by" count?
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Sql Order-By
Rails: what does schema.rb do?
Ruby on-Rails
Activerecord
How do I replace accented Latin characters in Ruby?
Ruby on-Rails
Ruby
Activerecord
Unicode
Utf 8
Correct datatype for latitude and longitude? (in activerecord)
Ruby on-Rails
Activerecord
Types
Rails - Best-Practice: How to create dependent has_one relations
Ruby on-Rails
Ruby
Activerecord
Ruby on-Rails-3
Associations
Remove duplicate records based on multiple columns?
Ruby on-Rails-3
Activerecord
Duplicates
Destroy
ActiveRecord: How to get all attributes of a model that can be mass-assigned?
Ruby on-Rails
Activerecord
ActiveRecord::StatementInvalid: PG InFailedSqlTransaction
Ruby on-Rails
Postgresql
Activerecord
Rollback
Pg
Ruby Activerecord IN clause
Ruby
Activerecord
How does Rails ActiveRecord chain "where" clauses without multiple queries?
Ruby on-Rails
Activerecord
Difference between after_create, after_save and after_commit in rails callbacks
Ruby on-Rails
Ruby
Activerecord
Callback
How to select rows where column value IS NOT NULL using CodeIgniter's ActiveRecord?
Php
Mysql
Codeigniter
Activerecord
Null
With Rails 4, Model.scoped is deprecated but Model.all can't replace it
Activerecord
Ruby on-Rails-4
In Rails, what's the difference between find_each and where?
Ruby on-Rails
Ruby
Ruby on-Rails-3
Ruby on-Rails-4
Activerecord
Rails Active Record find(:all, :order => ) issue
Ruby on-Rails
Ruby
Activerecord
Sort array returned by ActiveRecord by date (or any other column)
Ruby on-Rails
Ruby
Arrays
Activerecord
Rails ActiveRecord :joins with LEFT JOIN instead of INNER JOIN
Ruby on-Rails
Activerecord
Join
Left Join
Inner Join
Alias for column names in Rails
Ruby on-Rails
Database
Ruby on-Rails-3
Activerecord
Rails 3 + activerecord, the best way to "mass update" a single field for all the records that meet a condition
Ruby on-Rails
Activerecord
Remove order from ActiveRecord scope
Ruby on-Rails
Activerecord
Ransack
ActiveRecord Find By Year, Day or Month on a Date field
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Rails Activerecord
validates_uniqueness_of passes on nil or blank (without allow_nil and allow_blank)
Ruby on-Rails
Activerecord
Validates Uniqueness-Of
Getting types of the attributes in an ActiveRecord object
Ruby on-Rails
Ruby
Activerecord
Activemodel
How can I know when to "refresh" my model object in Rails?
Ruby on-Rails
Ruby
Testing
Activerecord
Rails 3 skip validations and callbacks
Ruby on-Rails
Ruby on-Rails-3
Activerecord
ActiveRecord OR query Hash notation
Ruby on-Rails
Ruby on-Rails-4
Activerecord
Rails Activerecord
Ruby on-Rails-5
When do I use save!, create! and update_attributes! in Rails?
Ruby on-Rails
Activerecord
Transactions
Rails 3 / Form without Model: How do I create a form that is not tied to a model?
Ruby on-Rails
Ruby on-Rails-3
Activerecord
How to select count with Laravel's fluent query builder?
Mysql
Activerecord
Fluent
Laravel
Eloquent
ActiveRecord find_each combined with limit and order
Sql
Ruby on-Rails
Activerecord
Is there a way to avoid automatically updating Rails timestamp fields?
Ruby on-Rails
Ruby
Activerecord
Timestamp
accepts_nested_attributes_for child association validation failing
Ruby on-Rails
Validation
Activerecord
Nested
Using Active Record generators after Mongoid installation?
Ruby on-Rails
Activerecord
Mongoid
Mongodb
Rails optional belongs_to
Ruby on-Rails
Ruby
Activerecord
Rails model without database
Ruby on-Rails
Ruby
Activerecord
How to Determine if Rails Association is Eager Loaded?
Ruby on-Rails
Activerecord
Eager Loading
Rails: ActiveRecord query based on association value
Ruby on-Rails
Ruby
Activerecord
Associations
Rails ActiveRecord: Find All Users Except Current User
Ruby on-Rails
Ruby
Activerecord
how to find the cause of ActiveRecord ROLLBACK
Ruby on-Rails
Activerecord
has_and_belongs_to_many, avoiding dupes in the join table
Ruby on-Rails
Activerecord
"WARNING: Can't mass-assign protected attributes"
Ruby on-Rails
Activerecord
Devise
Is there an easy way to make a Rails ActiveRecord model read-only?
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Does rename_column take care of indexes?
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Rails Activerecord
Database Indexes
How to delete all data from all tables in Rails?
Ruby on-Rails
Activerecord
GROUP BY and COUNT using ActiveRecord
Sql
Ruby on-Rails
Ruby
Postgresql
Activerecord
How can I count the number of records that have a unique value in a particular field in ROR?
Ruby on-Rails
Ruby
Activerecord
How can i remove a column from table using rails console
Ruby on-Rails
Activerecord
Ruby on-Rails-3.2
Rails Migrations
Rails 4 how to ignore pending migrations
Ruby on-Rails
Ruby
Activerecord
CodeIgniter Active Record - Get number of returned rows
Activerecord
Codeigniter
MongoDB vs MySQL
Mysql
Activerecord
Comparison
Mongodb
Ruby on-Rails-3
How to add an ORDER BY clause using CodeIgniter's Active Record methods?
Php
Codeigniter
Select
Activerecord
Sql Order-By
ActiveRecord Arel OR condition
Sql
Ruby on-Rails
Ruby
Activerecord
Arel
Rails ActiveRecord Query for Not Equal
Ruby on-Rails
Activerecord
Increment field of mysql database using codeigniter's active record syntax
Mysql
Sql
Codeigniter
Activerecord
Rails order by results count of has_many association
Ruby on-Rails
Ruby on-Rails-3
Activerecord
accepts_nested_attributes_for with find_or_create?
Ruby on-Rails
Validation
Forms
Activerecord
How to test for (ActiveRecord) object equality
Ruby on-Rails
Ruby
Activerecord
Identity
Equality
Ruby on Rails plural (controller) and singular (model) convention - explanation
Ruby on-Rails
Ruby
Activerecord
How do I force ActiveRecord to reload a class?
Ruby on-Rails
Ruby
Activerecord
Migration
Elegant way to structure models into subfolders without creating submodules
Ruby on-Rails
Activerecord
Rails 3 ActiveRecord: Order by count on association
Mysql
Ruby on-Rails
Ruby on-Rails-3
Activerecord
How to undefine class in Ruby?
Ruby
Ruby on-Rails-3
Activerecord
How to handle Ruby on Rails error: "Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'"
Ruby on-Rails
Ruby
Postgresql
Activerecord
Rubygems
How do you scope ActiveRecord associations in Rails 3?
Ruby on-Rails
Activerecord
Ruby on-Rails-3
Named Scope
Arel
Reserved names with ActiveRecord models
Ruby on-Rails
Ruby on-Rails-3
Activerecord
Ruby on-Rails-3.2
Active Record-Query
ruby super keyword
Ruby on-Rails
Ruby
Activerecord
What is the order of ActiveRecord callbacks and validations?
Ruby on-Rails
Ruby on-Rails-3
Validation
Activerecord
How to Create a New Table With a Unique Index in an Active Record / Rails 4 Migration
Ruby on-Rails
Activerecord
Ruby on-Rails-4