Episodes tagged with “active-record”
-
2
Dynamic find_by Methods
Shorten simple find and improve readability by using the dynamic find_by and find_all_by methods.
Tags: active-record
-
3
Find Through Association
Use a has_many association in a find to avoid the need to pass foreign keys.
Tags: active-record
-
14
Performing Calculations On Models
ActiveRecord provides class methods for performing calculations on models. See how in this episode.
Tags: active-record
-
15
Fun With Find Conditions
You can pass objects other than strings to find conditions, but care must be taken to ensure that the correct SQL is generated.
Tags: active-record
-
16
Virtual Attributes
Keep your forms flexible by adding virtual attributes to your model. This powerful technique allows you to create form fields which may not directly relate to the database.
Tags: active-record forms
-
22
Eager Loading
Improve the performance of your Rails application by reducing the number of database queries. Eager loading makes it easy.
Tags: performance active-record
-
23
Counter Cache Column
Improve performance by caching the record count for a has_many association in a counter cache column.
Tags: performance active-record
-
25
SQL Injection Other translations:
Attacks via SQL injection are one of the most common ways to attack web applications. Learn how to avoid being a victim of it.
Tags: security active-record forms
-
26
Hackers Love Mass Assignment
If you're using mass assigment you're giving complete control to your models to your users. Learn how to protect them in this episode.
Tags: security active-record forms
-
147
Sortable Lists
Find out how to create a drag and drop list using prototype and one of Rails’ helper methods.
Tags: active-record plugins ajax routing
-
32
Time in Text Field
Updating time fields via a series of dropdowns isn't the most elegant way to enter date and time information. Find out how to allow your users to enter dates and time in a text field instead.
Tags: active-record forms
-
4
Move Find Into Model
Clean up your controllers and remove duplication by moving a find into your model. Use an association to call custom find methods.
Tags: active-record
-
5
Using with_scope
Learn how to use with_scope - a very powerful method which will allow your custom find method to acceps any find options.
Tags: active-record
-
152
Rails 2.3 extras
A round of some of the smaller new feaures in Rails 2.3 to finish the short series on Rails 2.3.
-
154
Polymorphic Association
Polymorphic associations can be a little tricky to understand. In this episode we'll show you how to create one and use it in controllers and views.
Tags: active-record routing
-
162
Tree Based Navigation
The acts_as_tree plugin provides a good solution for handling a tree-based navigation. In this episode we build a navigation system with menus, subpages and a breadcrumb control.
Tags: active-record plugins
-
163
Self Referential Association
In this episode we create a small social networking application and use a self-referential association to link users with their friends.
Tags: active-record controllers
-
168
Feed Parsing
In this episode we use two different techniques to parse an RSS feed with Feedzirra.
Tags: plugins active-record
-
176
Searchlogic
Searchlogic uses named scopes to make searching against models simple. See how to create simple and more complex searches in this episode.
Tags: active-record plugins
-
33
Making a Plugin
Duplication can often be removed from your Ruby code by making methods dynamically. In this episode we make a plugin to do just that.
Tags: active-record plugins
-
177
Model Versioning
If you need to keep track of the changes to an ActiveRecord model and switch between versions the Vestal Versions gem is well worth considering.
Tags: active-record plugins
-
178
Seven Security Tips
Security is paramount in your Rails applications. Here we show seven commons security flaws from mass assignment to CSRF.
Tags: security forms views active-record
-
179
Seed Data
Rails 2.3.4 introduces a new convention for creating any seed data that your application needs. This means that you no longer have to put seed data in your migrations.
Tags: active-record rails-23
-
135
Making a Gem
Gems are now a more popular way of extending Rails than plugins. In this episode we go through the steps needed to create a basic gem.
Tags: plugins active-record tools
-
181
Include vs Joins
The find method’s include and joins options can be a little confusing as they are so similar. Find out when to use which one in this episode.
Tags: active-record
-
189
Embedded Association
In this episode we show you how to embed a one-to-many or many-to-many association in a single integer field.
Tags: active-record views
-
193
Tableless Model Other translations:
If you want to create a model without an associated database table all you need to do is define a couple methods in the model.
Tags: active-record
-
196
Nested Model Form Part 1 Other translations:
The accepts_nested_attributes_for method, introduced in Rails 2.3, makes handling multiple models in a form much easier. Find out how to use it in this episode.
Tags: forms views active-record
-
202
Active Record Queries in Rails 3 Other translations:
Rails 3 introduces a new query interface for performing finds in Active Record. See how it works along with the changes in named scopes.
Tags: rails-30 active-record
