Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #69 from Oscil8/a031cd4c8987214638521b8cb300fbb686…

…c50271

A couple more small improvements
  • Loading branch information...
commit cce53c78f53751ed7c4e72a71d61e8ee5f4b5046 2 parents b699c2d + a031cd4
@assaf assaf authored
View
6 lib/vanity/adapters/active_record_adapter.rb
@@ -78,8 +78,10 @@ def self.retrieve(experiment, identity, create = true, update_with = nil)
def initialize(options)
@options = options.inject({}) { |h,kv| h[kv.first.to_s] = kv.last ; h }
- @options["adapter"] = @options["active_record_adapter"] if @options["active_record_adapter"]
- VanityRecord.establish_connection(@options)
+ if @options["active_record_adapter"] && (@options["active_record_adapter"] != "default")
+ @options["adapter"] = @options["active_record_adapter"]
+ VanityRecord.establish_connection(@options)
+ end
end
def active?
View
2  lib/vanity/experiment/base.rb
@@ -181,7 +181,7 @@ def identity
def default_identify(context)
raise "No Vanity.context" unless context
raise "Vanity.context does not respond to vanity_identity" unless context.respond_to?(:vanity_identity)
- context.vanity_identity or raise "Vanity.context.vanity_identity - no identity"
+ context.send(:vanity_identity) or raise "Vanity.context.vanity_identity - no identity"
end
# Derived classes call this after state changes that may lead to
View
1  lib/vanity/frameworks/rails.rb
@@ -61,6 +61,7 @@ def use_vanity(symbol = nil, &block)
end
end
end
+ protected :vanity_identity
around_filter :vanity_context_filter
before_filter :vanity_reload_filter unless ::Rails.configuration.cache_classes
before_filter :vanity_query_parameter_filter
Please sign in to comment.
Something went wrong with that request. Please try again.