# Feedback for plugin: acts\_as\_readonly

**URL:** <https://www.ruby-forum.com/t/feedback-for-plugin-acts-as-readonly/168980>\
**Category:** Rails\
**Created:** [May 28, 2009, 2:30am UTC](https://www.ruby-forum.com/t/feedback-for-plugin-acts-as-readonly/168980 "2009-05-28T02:30:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 28, 2009, 2:30am UTC](https://www.ruby-forum.com/t/feedback-for-plugin-acts-as-readonly/168980/1 "2009-05-28T02:30:52Z")

</div>

All,  
I’m just announcing and looking for feedback for a quick little  
plugin I wrote: acts\_as\_readonly ([kevincolyar (Kevin Colyar) · GitHub](http://github.com/kevincolyar/)  
acts\_as\_readonly/tree/master)

Some info:

# ActsAsReadonly

acts\_as\_readonly is an ActiveRecord plugin that makes a model  
readonly, preventing its attributes from being set and calling methods  
like save, create, and destroy on it.

This plugin is useful for working with risky, legacy or third party  
database where data is only being viewed.

# Example

class MyModel \< ActiveRecord::Base  
acts\_as\_readonly  
end

# Installation

$ ./script/plugin install removed\_email\_address@domain.invalid:kevincolyar/  
acts\_as\_readonly.git

Thanks,  
Kevin

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 28, 2009, 12:20pm UTC](https://www.ruby-forum.com/t/feedback-for-plugin-acts-as-readonly/168980/2 "2009-05-28T12:20:21Z")

</div>

Why not use ActiveRecord’s readonly!() feature while fetching the  
record instead?

Readonly \<\> immutable in memory in my opinion. I don’t see why you  
need to raise exceptions for column assignments as long as they are  
not stored back to the database.

On May 28, 5:30 am, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
