twilio_contactable 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.8.1
data/lib/configuration.rb CHANGED
@@ -14,11 +14,11 @@ module TwilioContactable
14
14
  end
15
15
 
16
16
  def configuration
17
- @@configuration ||= Configuration.new
17
+ @configuration ||= Configuration.new
18
18
  end
19
19
 
20
20
  def configure(&block)
21
- @@configuration = Configuration.new(&block)
21
+ @configuration = Configuration.new(&block)
22
22
  end
23
23
  end
24
24
 
data/lib/contactable.rb CHANGED
@@ -39,10 +39,10 @@ module TwilioContactable
39
39
 
40
40
  # set up the configuration, available within the class object
41
41
  # via this same 'twilio_contactable' method
42
- model.instance_eval do
42
+ class << model
43
43
  def twilio_contactable(&block)
44
- @@twilio_contactable = Configuration.new(&block) if block
45
- @@twilio_contactable ||= Configuration.new
44
+ @twilio_contactable = Configuration.new(&block) if block
45
+ @twilio_contactable ||= Configuration.new
46
46
  end
47
47
  end
48
48
 
data/lib/controller.rb CHANGED
@@ -2,7 +2,7 @@ module TwilioContactable
2
2
  module Controller
3
3
 
4
4
  def self.included(controller)
5
- controller.instance_eval do
5
+ class << controller
6
6
  # the developer should specify which model(s) will be sought
7
7
  # when the app receives incoming requests.
8
8
  # See the 'Controller' part of the README for details
@@ -8,10 +8,14 @@ class TwilioContactableContactableTest < ActiveSupport::TestCase
8
8
  context "configuration" do
9
9
  TwilioContactable::Contactable::Attributes.each do |attr|
10
10
  context "attribute: #{attr}" do
11
- should "begin with appropriate default for #{attr}_column and allow overwriting" do
11
+ should "begin with appropriate default for #{attr}_column" do
12
12
  klass = Class.new
13
13
  klass.send :include, TwilioContactable::Contactable
14
14
  assert_equal attr, klass.twilio_contactable.send("#{attr}_column")
15
+ end
16
+ should "allow overwriting the default" do
17
+ klass = Class.new
18
+ klass.send :include, TwilioContactable::Contactable
15
19
  klass.twilio_contactable do |config|
16
20
  config.send("#{attr}_column=", :custom_column)
17
21
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{twilio_contactable}
8
- s.version = "0.8.0"
8
+ s.version = "0.8.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jack Danger Canty"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio_contactable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
9
+ - 1
10
+ version: 0.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jack Danger Canty