Skip to content

Commit

Permalink
Merge pull request galetahub#15 from smaboshe/master
Browse files Browse the repository at this point in the history
Fix set_table_name deprecation warning
  • Loading branch information
galetahub committed Feb 6, 2012
2 parents 580b73f + 497ff8c commit af816e6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/simple_captcha/simple_captcha_data.rb
@@ -1,6 +1,16 @@
module SimpleCaptcha
class SimpleCaptchaData < ::ActiveRecord::Base
set_table_name "simple_captcha_data"
def self.rails3?
::ActiveRecord::VERSION::MAJOR == 3
end

if rails3?
# Fixes deprecation warning in Rails 3.2:
# DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead.
self.table_name = "simple_captcha_data"
else
set_table_name "simple_captcha_data"
end

attr_accessible :key, :value

Expand Down

0 comments on commit af816e6

Please sign in to comment.