# Database.yml for the ActsAsReadonlyable plugin

**URL:** <https://www.ruby-forum.com/t/database-yml-for-the-actsasreadonlyable-plugin/128911>\
**Category:** Rails\
**Created:** [February 12, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/database-yml-for-the-actsasreadonlyable-plugin/128911 "2008-02-12T16:30:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [February 12, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/database-yml-for-the-actsasreadonlyable-plugin/128911/1 "2008-02-12T16:30:45Z")

</div>

Hi,

I’m currently looking at pulling the ActsAsReadonlyable plugin into my  
rails project but im getting an error when i attempt to run this is  
development mode as in the console says: No db config entry defined for  
read\_only.

The setup prior to the plugin was:

development:  
adapter: mysql  
host: 127.0.0.1  
encoding: utf8  
database: dbv2  
username: root  
password:

readonlydb\_development:  
adapter: mysql  
host: 127.0.0.1  
encoding: utf8  
database: dbv2  
username: root  
password:

any ideas?

Chris

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [February 12, 2008, 6:14pm UTC](https://www.ruby-forum.com/t/database-yml-for-the-actsasreadonlyable-plugin/128911/2 "2008-02-12T18:14:27Z")

</div>

Hi Bill,

So now I have:

development:  
adapter: mysql  
host: 127.0.0.1  
encoding: utf8  
database: dbv2  
username: root  
password:

read\_only:  
adapter: mysql  
host: 127.0.0.1  
encoding: utf8  
database: bv2  
username: root  
password:

… but I’m still getting the same error in the console. I’ve tried  
rebooting and loading up the plugin again but to no success.

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [February 12, 2008, 6:05pm UTC](https://www.ruby-forum.com/t/database-yml-for-the-actsasreadonlyable-plugin/128911/3 "2008-02-12T18:05:52Z")

</div>

Hi Chris,

Chris G. wrote:

> encoding: utf8  
> database: dbv2  
> username: root  
> password:

Change this:

> readonlydb\_development:

To this:  
:readonly

> adapter: mysql  
> host: 127.0.0.1  
> encoding: utf8  
> database: dbv2  
> username: root  
> password:

You don’t need to identify the entry as belonging to a particular  
environment. The plugin parses database.yml in sections by environment.

Here’s what the development section of mine looks like. It works fine.

development:  
adapter: mysql  
database: wcpublic\_development  
username: root  
password:  
host: localhost

read\_only:  
adapter: mysql  
database: wcpublic\_development  
username: root  
password:  
host: localhost

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [February 12, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/database-yml-for-the-actsasreadonlyable-plugin/128911/4 "2008-02-12T18:34:52Z")

</div>

Chris G. wrote:

> Actually it all seems to work fine now.

Congrats!

> Thanks for your help 🙂

You’re welcome.

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [February 12, 2008, 6:21pm UTC](https://www.ruby-forum.com/t/database-yml-for-the-actsasreadonlyable-plugin/128911/5 "2008-02-12T18:21:48Z")

</div>

Actually it all seems to work fine now. I may have had an issue with the  
.yml file not being parsed correctly.

Thanks for your help 🙂

Chris
