Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Silence warnings in development mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
epitron committed Oct 11, 2011
1 parent 7930376 commit ecad9d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/letmein.rb
Expand Up @@ -139,7 +139,11 @@ def self.accessor(name, index = 0)
self.config.models.each do |model|
klass = model.constantize rescue next
klass.send :include, LetMeIn::Model
Object.const_set("#{model.to_s.camelize}Session", Class.new(LetMeIn::Session))

session_model = "#{model.to_s.camelize}Session"

Object.send(:remove_const, session_model) if (Object.const_get(session_model) rescue nil) # remove the constant if it's defined, so that we don't get spammed with warnings.
Object.const_set(session_model, Class.new(LetMeIn::Session))
end
end
end

0 comments on commit ecad9d3

Please sign in to comment.