Notes posted by allenRSS feed
Resources are added after the :path_prefix. However if you use a :path_prefix on a resource, it overrides the namespace path instead of appending to it (as I think it should).
Here is what I wrote to create a versioned API access path.
map.namespace :api3, :path_prefix=>"/api/v3" do |api| api.resources :posts api.resources :comments, :path_prefix=>"/api/v3/post/:post_id" end
This will create routes like
path: /api/v3/posts/1 named_route: api3_post() controller=>"api3/posts"
The join executes a large query and returned potentially duplicate records for a one-to-many association. After 2.1, the query is broken down and eager-loaded using an additional query per association, passing the set of id’s to load, and avoiding the duplicate rows.
The new method eliminates duplicates, but can incur more database overhead. If you are loading a very large set of records (more than a “page”), you may need to “force” the join or use find_by_sql instead.
When you specify a “table.column” syntax within a
Whenever you reference a column from another table in a condition or order clause, ALWAYS use the table name to prefix the column, even if it not ambiguous among the tables involved. Otherwise the query will not be executed as a join and you will receive an SQL error referencing the “missing” column.
You can “force” a join by adding a reference to the other tables in your :conditions or :options parameters, even if the test or sort is irrelevant.
This is a convenience to set multiple attributes at the same time. It calls the “setter” method
for each key in the hash. If you have overridden the setter to add functionality, it will be called.