ardm-active_model 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 914b0870e37e4d5287c192bdea00965b86f83ac8
4
- data.tar.gz: 23b3a36468ab60b8a468a88f701a8e8731bbcf48
3
+ metadata.gz: e6f6c4708c51eff3663adead13142aedd6002044
4
+ data.tar.gz: b13e5c582565bc89febb650846d3141d960df832
5
5
  SHA512:
6
- metadata.gz: d9e90d018c2691c64e3a3b9d03cd36c2a7a9341230df8d8acf3f67f2741d243ae5716af0169819a11738221af170a037066d555cfedfb80958386a42e5342c4c
7
- data.tar.gz: 13bc8f8ebe38ce8e87ecbfc25441138a83f3b793cd6141b163ab58454888832665df9f44572a5343415b9e15f37cc31068f5f4f02512aabce8a951ca874fec9d
6
+ metadata.gz: ee28484dc877534d9255f7a071414ccca6f133a77bca7f822b18e0ee9ac966ba739bedc27cc89670e6f215db069ce8a4e42fd785887b897b294fc0a3f6501437
7
+ data.tar.gz: 5ffc7d460670092e8794e5fa932c801913fc50f8cc6a457693a4017fb3faf1df4d75499925b1bc4a944bd0edde3bbedb5425955ac3ab39588b6b204a9823c83e
data/Gemfile CHANGED
@@ -7,12 +7,11 @@ gemspec
7
7
  SOURCE = ENV.fetch('SOURCE', :git).to_sym
8
8
  REPO_POSTFIX = SOURCE == :path ? '' : '.git'
9
9
  DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'https://github.com/ar-dm'
10
- DM_VERSION = '~> 1.2.0'
10
+ DM_VERSION = '~> 1.2'
11
11
  CURRENT_BRANCH = ENV.fetch('GIT_BRANCH', 'master')
12
- RAILS_VERSION = '~> 3.1.0'
12
+ RAILS_VERSION = [ '>= 3.0', '< 5.0' ]
13
13
 
14
14
  gem 'ardm-core', DM_VERSION, SOURCE => "#{DATAMAPPER}/ardm-core#{REPO_POSTFIX}", :branch => CURRENT_BRANCH
15
-
16
15
  gem 'activemodel', RAILS_VERSION, :require => nil
17
16
 
18
17
  group :development do
@@ -1,10 +1,15 @@
1
1
  require 'dm-core'
2
+ require 'active_support/core_ext/module/delegation' # needed by active_model/naming
3
+ require 'active_support/core_ext/module/remove_method' # needed for Module.remove_possible_method in active_model/naming.rb (active_model ~> 4.1)
4
+ require 'active_support/concern' # needed by active_model/conversion
2
5
  require 'active_model/naming'
6
+ require 'active_model/conversion'
3
7
 
4
8
  module DataMapper
5
9
  module ActiveModel
6
10
 
7
11
  module InstanceMethods
12
+ include ::ActiveModel::Conversion
8
13
 
9
14
  def to_model
10
15
  self
@@ -50,6 +55,7 @@ module DataMapper
50
55
  end
51
56
 
52
57
  Model.append_extensions(::ActiveModel::Naming)
58
+ Model.append_extensions(::ActiveModel::Conversion::ClassMethods)
53
59
  Model.append_inclusions(ActiveModel::InstanceMethods)
54
60
 
55
61
  end
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
2
  module ActiveModel
3
- VERSION = '1.2.0'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec/test/unit'
2
+ require 'active_support/core_ext/object/blank' # needed by active_model/lint
2
3
  require 'active_model/lint'
3
4
 
4
5
  # This must be kept in sync with active_model/lint tests
@@ -12,29 +13,9 @@ share_examples_for 'an active_model compliant object' do
12
13
 
13
14
  include ActiveModel::Lint::Tests
14
15
 
15
- it 'must implement the #to_key interface' do
16
- test_to_key
16
+ instance_methods.grep(/^test_/).each do |meth|
17
+ it meth.to_s do
18
+ send(meth)
19
+ end
17
20
  end
18
-
19
- it 'must implement the #to_param interface' do
20
- test_to_param
21
- end
22
-
23
- it 'must implement the #valid? interface' do
24
- test_valid?
25
- end
26
-
27
- it 'must implement the #persisted? interface' do
28
- test_persisted?
29
- end
30
-
31
- it 'must implement the #model_naming interface' do
32
- test_model_naming
33
- end
34
-
35
- it 'must implement the #errors interface' do
36
- test_errors_aref
37
- test_errors_full_messages
38
- end
39
-
40
21
  end
@@ -10,5 +10,4 @@ share_examples_for 'an active_model/validations compliant object' do
10
10
  send("test_#{validation_method}")
11
11
  end
12
12
  end
13
-
14
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ardm-active_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Emde