neerajsingh0101 / admin_data

A non instrusive gem which helps you browse, search and manage your data using browser
http://admin-data-demo.heroku.com/admin_data
MIT License
376 stars 56 forks source link

Enable direct usage of blocks in configuration #59

Closed anibali closed 13 years ago

anibali commented 13 years ago

Currently users specify security settings by passing a proc or lambda:

config.is_allowed_to_view = lambda {|controller| return true if Rails.env.development? }

My commit enables the usage of blocks directly:

config.is_allowed_to_view {|controller| return true if Rails.env.development? }

I could not get your test cases to run, so you probably want to make sure that this doesn't break anything yourself.

neerajsingh0101 commented 13 years ago

I see what you are saying but I don't want to break the convention for just one setter. Currently all configuration works by having = and I am going to stick with it unless all of them are converted.

If you send another pull request with just README changes then I would appreciate that.

Thanks