Rails plugin to separate model concerns into multiple files.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib initial commit Sep 24, 2008
tasks initial commit Sep 24, 2008
test initial commit Sep 24, 2008
MIT-LICENSE initial commit Sep 24, 2008
README initial commit Sep 24, 2008
Rakefile initial commit Sep 24, 2008
init.rb initial commit Sep 24, 2008
install.rb initial commit Sep 24, 2008
uninstall.rb initial commit Sep 24, 2008

README

ConcernedWith
=============

Simple way to separate model concerns into separate files. Code is from Rick Olson's altered_beast project.


Example
=======

# app/models/user.rb
class User < ActiveRecord::Base
  concerned_with :validations, :authentication
end

# app/models/user/validations.rb
class User < ActiveRecord::Base
  validates_presence_of :name
end

#app/models/user/authentication.rb
class User < ActiveRecord::Base
  def self.authenticate(name, password)
    find_by_name_and_password(name, password)
  end
end


Copyright (c) 2008 Jake Howerton, released under the MIT license