database.yml for the ActsAsReadonlyable plugin

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

Hi Chris,

Chris Gallagher wrote:

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:

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

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.

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 :slight_smile:

Chris

Chris Gallagher wrote:

Actually it all seems to work fine now.

Congrats!

Thanks for your help :slight_smile:

You're welcome.

Best regards,
Bill