rubenrails / acts_as_opengraph

ActiveRecord extension that turns your models into Facebook's Open Graph objects.
MIT License
53 stars 17 forks source link

Fix for deprecation warning in Rails 3.1, also some unit test suite fixes #5

Closed nbudin closed 12 years ago

nbudin commented 12 years ago

Hi Ruben, thanks for acts_as_opengraph! We've been using it for gively.com, which is running on Rails 3.1.

I noticed some deprecation warnings originating in acts_as_opengraph. Specifically, class_inheritable_attribute and its related methods are due to be removed in a future version of Rails, and replacing them with class_attribute is recommended. I've made a small patch for acts_as_opengraph to do just that.

(Note that this patch will break compatibility with Rails versions below 3.0 - I'm not sure if that is important to you; if it is, we can probably use a respond_to? check to keep that compatibility.)

I wanted to make sure this didn't break anything, so I tried running the unit test suite, but along the way I found some problems:

I fixed those, and I also added a rake/testtask so you can just run bundle exec rake test from the command line.