Skip to content

Commit

Permalink
Updated rspec and silenced depreciation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Oberholzer committed Aug 18, 2011
1 parent fb25ff1 commit ad5118e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 5 additions & 2 deletions lib/easy_roles.rb
Expand Up @@ -12,8 +12,11 @@ def easy_roles(name, options = {})

if options[:method] == :serialize
serialize name.to_sym, Array
respond_to?(:before_validation_on_create) ? before_validation_on_create(:make_default_roles) : before_validation(:make_default_roles, :on => :create)


ActiveSupport::Deprecation.silence do
respond_to?(:before_validation_on_create) ? before_validation_on_create(:make_default_roles) : before_validation(:make_default_roles, :on => :create)
end

class_eval <<-EOC
def has_role?(role)
#{name}.include?(role)
Expand Down
6 changes: 1 addition & 5 deletions spec/spec_helper.rb
Expand Up @@ -4,11 +4,7 @@
require 'active_record'
require 'easy_roles'

require 'spec'
require 'spec/autorun'


Spec::Runner.configure do |config|
RSpec.configure do |config|
end

ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
Expand Down

0 comments on commit ad5118e

Please sign in to comment.