Skip to content
This repository

Build models one module at a time.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 docs @ 8951f41
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 active-behavior.gemspec
README.md

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.

Something went wrong with that request. Please try again.