coded_options 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -13,7 +13,7 @@ into
13
13
 
14
14
  STATES = %w(initial active closed)
15
15
  STATE_OPTIONS = [["initial", 0], ["active", 1], ["closed", 2]]
16
-
16
+
17
17
  def state
18
18
  return unless state_id
19
19
  STATES[state_id]
@@ -34,6 +34,12 @@ a plain Ruby object as follows:
34
34
  foo.type_id = 1
35
35
  foo.type #=> awesome
36
36
 
37
+ If you want to use this with MongoDB, just add
38
+
39
+ extend CodedOptions
40
+
41
+ to your model.
42
+
37
43
  Installation
38
44
  ------------
39
45
 
@@ -1,3 +1,3 @@
1
1
  module CodedOptions
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  module CodedOptions
2
2
  class Railtie < Rails::Railtie
3
3
  initializer "coded_options.initialize" do |app|
4
- ActiveRecord::Base.send :extend, CodedOptions
4
+ ActiveRecord::Base.send :extend, CodedOptions if defined?(ActiveRecord)
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coded_options
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jason Dew