Sha256: 7b2cb3dcafcce3c0d38475ddec803214502c3fe3f58c9c295fe0d05ccd9166ec

Contents?: true

Size: 949 Bytes

Versions: 5

Compression:

Stored size: 949 Bytes

Contents

# RelationToStruct

When one needs to use ActiveRecord to fetch specific values (whether subset columns of a model or arbitrary calculated columns), it's desirable to avoid the overhead of model instances and any associated callbacks.

ActiveRecord::Relation#pluck solves a similar problem but returns tuples; I wanted to be able to return Ruby structs to benefit from named instance methods.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'relation_to_struct'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install relation_to_struct

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it ( https://github.com/[my-github-username]/relation_to_struct/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
relation_to_struct-0.0.5 README.md
relation_to_struct-0.0.4 README.md
relation_to_struct-0.0.3 README.md
relation_to_struct-0.0.2 README.md
relation_to_struct-0.0.1 README.md