This is a simple plugin which supports "class/instance.methods" being held inside of records
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
README.rdoc
Rakefile
init.rb

README.rdoc

method_ni

method_ni is a simple extension for ActiveRecord. You can easily store methods inside of records and evalute them on demand. I'll give a short example:

Usage

In your model:
  class Service < ActiveRecord::Base  
    has_method_in :custom_method
    validates_syntax_of :custom_method 
  end

In your controller:  
  class OuterAccountsController < ApplicationController

    def create
      Service.create :custom_method => %{def one;1;end}
    end

    def show
      @service = Service.find(1)
      @service.apply_methods!

      @service.applied_methods => ["one"]
      result = @service.one
    end
  end

Install

ruby script/plugin intall git://github.com/kairichard/method_ni.git

Misc

Tests can be run outside of Rails