README.md in acts_as-0.1.0 vs README.md in acts_as-0.1.1
- old
+ new
@@ -1,12 +1,13 @@
# ActsAs
-ActiveRecord extension for easy belongs_to composition and delegation
+Essentially, this is just a wrapper around the usual [ActiveRecord::Assocations::Classmethods#belongs_to](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-belongs_to) that inlines delegation of all active_record attribute setters/getters/helpers (with prefix support) and any additional methods, thus serving as a proxy for another table and model.
* Transparently write to multiple tables from one active record model by proxying attributes and their methods through a second model.
* Easily extract a new table from an existing table, but keep the existing API intact without breaking any consumers.
* When using STI to maintain easy joins, this is an easy way to proxy unique child attributes through to another table for that child
+* Can help you enforce the [Law of Demeter](http://en.wikipedia.org/wiki/Law_of_Demeter)
This is designed for any belongs_to relationship where lifecycles are tightly coupled and proxying of attribute helpers from belongs_to -> has_one is desired.
(see example below and /spec for more detail)
@@ -14,18 +15,14 @@
Add this line to your application's Gemfile:
gem 'acts_as'
-And then execute:
+And then:
$ bundle
-Or install it yourself as:
-
- $ gem install acts_as
-
## Usage
```ruby
# This pattern encourages foreign keys to be stored on the STI's root table for easy reads.
@@ -91,10 +88,11 @@
How does the active record join hash-parsing stuff work? EX-
Rebel.joins(:clan).where(clan: {cool: true)
Can we make this work for ruby-sql autojoins? Is that even a good idea?
- Rebel.where(cool: true) #auto-joins :clan
+
+ Rebel.where(cool: true) #auto-joins :clan and queries clans table
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)