lotus/model — pull request #102 by jodosha (2014-11-22 23:34:59+00:00)
Title: Implement SQL inner join

## SQL joins

Given the following mapping:

```ruby
Lotus::Model::Mapper.new do
collection :users do
entity User
repository UserRepository

attribute :id, Integer
attribute :name, String
end

collection :orders do
entity Order
repository OrderRepository

attribute :id, Integer
attribute :user_id, Integer
attribute :total, Integer
end
end
```

### Inner join

```ruby
class OrderRepository
include Lotus::Repository

def self.foo
query do
join(:users)
end
end
end
```

```sql
SELECT `orders`.* FROM `orders` INNER JOIN `users` ON (`users`.`id` = `orders`.`user_id`)
```

Closes #34