To make an automatic ActiveRecord database connection using ENV['DATABASE_URL'] The following snippet can be used:
From ActiveRecord 3.2 …
read moreTo make an automatic ActiveRecord database connection using ENV['DATABASE_URL'] The following snippet can be used:
From ActiveRecord 3.2 …
read moreTo connect to a rails style DB config outside of the normal workflow, or using a database.yml in a …
read moreBased on an old Article I wrote, investigating incase sensitive sorting performance.
I have an active record model call Tag …
read moreUsing Tags (An active record model) to find tags by the tag property:
Tag.find_by_tag("Ruby")
Ruby
Tag.find_by_tag(["Ruby …
When running a sequel migration I kept getting this error:
Error: NoMethodError: undefined method `compact' for nil:NilClass
My setup …
read moreIn Active Record when updating records I used to have an very manual process to this some thing like:
@todo …
When working with databases it is often a requirement to have unique elements (columns) which are not the primary key …
read moreAn example of joining tables through active record models. There is a good tutorial on the basics of Activerecord joins …
read more