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.