has_constant 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -39,8 +39,6 @@ rescue LoadError
39
39
  end
40
40
  end
41
41
 
42
- task :test => :check_dependencies
43
-
44
42
  task :default => :test
45
43
 
46
44
  require 'rake/rdoctask'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
data/has_constant.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{has_constant}
8
- s.version = "0.3.0"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mattbeedle"]
12
- s.date = %q{2010-12-19}
12
+ s.date = %q{2011-01-10}
13
13
  s.description = %q{Allows certain fields to be limited to a set of values}
14
14
  s.email = %q{mattbeedle@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -41,4 +41,4 @@ module HasConstant
41
41
  end
42
42
  end
43
43
  end
44
- end if defined?(ActiveRecord::Base)
44
+ end
@@ -60,4 +60,4 @@ module HasConstant
60
60
  end
61
61
  end
62
62
  end
63
- end if defined?(Mongoid)
63
+ end
data/lib/has_constant.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  require 'active_support'
2
- require 'has_constant/orm/mongoid' if defined?(Mongoid)
3
- require 'has_constant/orm/active_record' if defined?(ActiveRecord::Base)
2
+ require 'has_constant/orm/mongoid'
3
+ require 'has_constant/orm/active_record'
4
4
  require 'active_support/inflector'
5
+
5
6
  module HasConstant
6
7
  extend ActiveSupport::Concern
7
8
 
@@ -7,7 +7,7 @@ class User < ActiveRecord::Base
7
7
  include HasConstant::Orm::ActiveRecord
8
8
 
9
9
  has_constant :salutations, ['Mr', 'Mrs']
10
- end if defined?(ActiveRecord)
10
+ end
11
11
 
12
12
  class ActiveRecordTest < Test::Unit::TestCase
13
13
  should 'save values as integers' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_constant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - mattbeedle
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-19 00:00:00 +01:00
18
+ date: 2011-01-10 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency