title: How to define a singleton method readonly for method of an instance in rails 3.2.12?
body: <p>In our rails 3.2.12 app, we want to inject a method readonly to the method of an <code>instance</code> to mark a column as <code>readonly</code> or not. Ideally we can define ONE generic method <code>readonly</code> for all method of an <code>instance</code> of each and every <code>model</code> in the app. </p>
  
  <p>For example, <code>@project</code> is an instance of the <code>Project model</code>. There is an <code>phone#</code> in the <code>@project</code>. After method injection, we can evaluate <code>@project.phone.readonly</code> (true or false) at run time. If there is another model <code>customer</code> in the app, we can do <code>@customer.name.readonly</code> assuming <code>@customer</code> is an <code>instance</code> of the <code>customer</code>. </p>
  
  <p>We feel <code>singleton class</code> and <code>define_method</code> may help here. But we are not quite understand how they are going to work. Can someone shed some light on the issue? Thanks for the help.</p>