# ActsAsConfigurable?

**URL:** <https://www.ruby-forum.com/t/actsasconfigurable/150237>\
**Category:** Rails\
**Created:** [October 6, 2008, 12:53pm UTC](https://www.ruby-forum.com/t/actsasconfigurable/150237 "2008-10-06T12:53:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [October 6, 2008, 12:53pm UTC](https://www.ruby-forum.com/t/actsasconfigurable/150237/1 "2008-10-06T12:53:32Z")

</div>

Hi there,  
does anyone kow of an existing “ActsAsConfigurable” type plugin?

I want to say;

class Organisation  
acts\_as\_configurable :properties =\> {  
:some\_property =\> {:type =\> :boolean, :default =\> false}  
}  
end

and then configure it by;

organisation.config\_for(:some\_property) # =\> false # the default  
organisation.set\_config\_for(:some\_property, true)

rather than cluttering up all of my tables with boolean flags.

If not, then I’m going to build it anyway.  
So let me know if you’re interested.

Matthew R. Jacobs

> **[RudyWriter](https://rudywriter.com/)**
>
> Matthew Rudy is a Golf Digest senior writer and author of more than 30 books.

---

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [October 6, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/actsasconfigurable/150237/2 "2008-10-06T16:36:42Z")

</div>

Matthew R. Jacobs wrote:

> Hi there,  
> does anyone kow of an existing “ActsAsConfigurable” type plugin?

This is what I came up with;

class Organisation \< ActiveRecord::Base  
acts\_as\_configurable :some\_property =\> {  
:default =\> “left”,  
:options =\> [“left”, “middle”, “right”],  
:description =\> “Where should we put something?”}  
end

then just;

organisation.some\_property # uses the default if it has not been set  
organisation.some\_property = “middle”

> **[GitHub - matthewrudy/acts\_as\_configurable: Avoid cluttering your Rails...](https://github.com/matthewrudy/acts_as_configurable)**
>
> Avoid cluttering your Rails models, ActsAsConfigurable abstracts all your configuration away with a polymorphic config store - GitHub - matthewrudy/acts\_as\_configurable: Avoid cluttering your Rails...

Will add support for Boolean attributes some time soon.

> **[RudyWriter](https://rudywriter.com/)**
>
> Matthew Rudy is a Golf Digest senior writer and author of more than 30 books.
