Nick Sanders
Nick Sanders

Reputation: 703

extend ruby on rails activerecord from gem

I have an idea to write a gem but I don't have enough experience in extending ruby on rails.

So here is what I want

For example here is a model file

class Modelname < ActiveRecord::Base
    methodname :columnname
end

So what "methodname" does is that it activates hook before db create/update and modifies "columnname" text

Upvotes: 0

Views: 149

Answers (1)

edralph
edralph

Reputation: 1831

How is this different to

Object.update_attribute( :columnname, "value" )

Or a before_filter that calls a method with the above behaviour?

Upvotes: 2

Related Questions