active-behavior

Put each association into it's own behavior module. This makes testing and organizing your Rails app a lot easier when it gets big.


License
MIT
Install
gem install active-behavior -v 0.2.1

Documentation

ActiveBehavior

Build your models one module at a time.

Usage

Install:

gem install active-behavior

Folder structure:

app/behaviors/user/attributes.rb
app/behaviors/user/posts.rb
app/behaviors/user/settings.rb
app/behaviors/post/users.rb
app/behaviors/post/comments.rb
...

Define the module:

module User::Posts
  base do
    has_many :posts
  end

  module ClassMetho

  end

  module InstanceMethods

  end
end

Include in class:

class User < ActiveRecord::Base
  behaviors :attributes, :settings, :posts
end

MIT License. © 2011 Big Lobby LLC. All rights reserved.