valle 1.1.0 → 1.1.1

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: 03548fc5db23ebbefcdbfd0215fd6b770b37ae5b
4
- data.tar.gz: c5254b2a714721e09610e9f7b958a00f61813a3b
3
+ metadata.gz: 5ca0aea17b7da5744740b3dfcf3455854bb014a9
4
+ data.tar.gz: 0e78df15afcdfd34a21c93a98e96468c67664e5c
5
5
  SHA512:
6
- metadata.gz: 79dcc9f84474cd7578106b21aad7c6533cfb13e526867d14a5846307ccfcf7f2bf511c98f71a892da3e5666dae71dac882d28d0cd334850f016120c352d3a84a
7
- data.tar.gz: ab8ec2d290146f03dfd7e1a139ecc7e75d3ee02c4944487fdb344050526d2fb54b6ef4ff2516ca3dd689eb3af77b3895e2c0759ae78ee73423f4cfc54629fd71
6
+ metadata.gz: bca7bae0f542cf6f28b4c9c286f2b03747d02fcb09331f303c078d829afc92dca237a1ad422e0ea5366cf86cf9b1d5a6656d0842a28e74e237b9b08df6475b03
7
+ data.tar.gz: 42e8c838dfbc2e782424d68eff7527c406faa0b7ff6df3fda4350e9abe31a068f318c69416d0e4783083c9ec9bc128d790d24ae326243f553f95861708b80d30
@@ -1,3 +1,7 @@
1
+ ## 1.1.1 / 2016-03-31
2
+
3
+ * fixed DEPRECATION WARNING: alias_method_chain is deprecated (#26) [Anton Kalyaev]
4
+
1
5
  ## 1.1.0 / 2016-03-18
2
6
 
3
7
  * fixed #23: issue with config.chache_classes=true [a.nikishin]
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Valle [![Build Status](https://secure.travis-ci.org/kaize/valle.png "Build Status")](http://travis-ci.org/kaize/valle) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/kaize/valle)
1
+ # Valle [![Build Status](https://travis-ci.org/akalyaev/valle.svg?branch=master)](https://travis-ci.org/akalyaev/valle) [![Code Climate](https://codeclimate.com/github/akalyaev/valle/badges/gpa.svg)](https://codeclimate.com/github/akalyaev/valle) [![Gem Version](https://badge.fury.io/rb/valle.svg)](https://badge.fury.io/rb/valle)
2
2
 
3
3
  Valle automatically creates validations for the minimum and maximum values of fields in your ActiveRecord model(s). No more worrying that string lengths or ID values will exceed the permissible DB limits!
4
4
 
data/Rakefile CHANGED
@@ -10,7 +10,6 @@ Rake::TestTask.new do |t|
10
10
  end
11
11
 
12
12
  Cucumber::Rake::Task.new(:cucumber) do |t|
13
- t.fork = true
14
13
  t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
15
14
  end
16
15
 
@@ -1,4 +1,17 @@
1
1
  module Valle
2
+
3
+ ##
4
+ # Extends the ActiveRecord's inherited method
5
+ #
6
+ module ActiveRecordExt
7
+ def inherited(subclass)
8
+ super
9
+ if Valle::Hooks.can_add_validators?(subclass, self)
10
+ Valle::Hooks.add_validators(subclass)
11
+ end
12
+ end
13
+ end
14
+
2
15
  class Hooks
3
16
 
4
17
  class << self
@@ -8,25 +21,15 @@ module Valle
8
21
  #
9
22
  def init
10
23
  ActiveSupport.on_load(:active_record) do
11
- Valle::Hooks.extend_inherited_method if Valle.enabled?
24
+ Valle::Hooks.run if Valle.enabled?
12
25
  end
13
26
  end
14
27
 
15
28
  ##
16
- # Extends the functionality of inherited method
29
+ # Runs all the hooks, required for this gem
17
30
  #
18
- def extend_inherited_method
19
- ActiveRecord::Base.class_eval do
20
- class << self
21
- def inherited_with_valle_validators(subclass)
22
- inherited_without_valle_validators(subclass)
23
- if Valle::Hooks.can_add_validators?(subclass, self)
24
- Valle::Hooks.add_validators(subclass)
25
- end
26
- end
27
- alias_method_chain :inherited, :valle_validators
28
- end
29
- end
31
+ def run
32
+ ActiveRecord::Base.singleton_class.include(Valle::ActiveRecordExt)
30
33
  end
31
34
 
32
35
  ##
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = "valle"
15
15
  gem.require_paths = ["lib"]
16
- gem.version = "1.1.0"
16
+ gem.version = "1.1.1"
17
17
 
18
18
  gem.add_dependency 'activerecord', '>= 3.0'
19
19
  gem.add_dependency 'activesupport'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Kalyaev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-18 00:00:00.000000000 Z
11
+ date: 2016-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord