valle 1.0.0 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9cfb09e0752993ed015ff6737ffb430e1c3ec37d
4
- data.tar.gz: ee3bb21e2c0dddefac91cd8bfdaea011d1c26b7f
3
+ metadata.gz: 7c0c148d64fc0b076b0575401d9c4918333fb7b8
4
+ data.tar.gz: 94db8d353ef331cd637eba7186e2509ab021035f
5
5
  SHA512:
6
- metadata.gz: 864f0b25a5c2e7f360dd2fbfa3cd7e86814491a316b4dfea97598524d4aa82f5a9ed97e95f044df9d5524bd91ecd5a0a80ad739d194fd2f479687426313f41c6
7
- data.tar.gz: a8b91e752476c7d15657122477c327bb2e79030a14f4297ec03ca276e8212b66beff4a0d89784db3ea2366a2428b0cc38770d36309347dbc12fd611c9a2ee5db
6
+ metadata.gz: bb10fe590b5426ed77e95da67aabd3800379a6d3afc2c625f22a48c08e3e6b91c1ad9787e84b15d4f6da1a1dd38f2314332320dbc1a5e2c26d92840ee9bec0d0
7
+ data.tar.gz: feb65d2c8e597d4623f35e72735f886318ba3a17cf18ec2aa7b5b58d2be315cca52f4c66d722372a5a3d2ac392036fdd9bb04b80d8450c1f7ce7e6a5679ffabb
@@ -2,6 +2,7 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
+ - 2.1.0
5
6
  branches:
6
7
  only:
7
8
  - master
@@ -1,3 +1,7 @@
1
+ ## 1.0.1 / 2014-07-22
2
+
3
+ * fix has_and_belongs_to_many causes Model to crash on initialization (#18) [Anton Kalyaev]
4
+
1
5
  ## 1.0.0 / 2014-01-14
2
6
 
3
7
  * attributes option changed to exclude_attributes [Anton Kalyaev]
@@ -0,0 +1,33 @@
1
+ # Contributing
2
+
3
+ We love pull requests. Here's a quick guide.
4
+
5
+ Fork, then clone the repo:
6
+
7
+ git clone git@github.com:your-username/valle.git
8
+
9
+ Make sure the tests pass:
10
+
11
+ rake
12
+
13
+ Make your change. Add tests for your change. Make the tests pass:
14
+
15
+ rake
16
+
17
+ Push to your fork and [submit a pull request][pr].
18
+
19
+ [pr]: https://github.com/kaize/valle/compare/
20
+
21
+ At this point you're waiting on us. We like to at least comment on pull requests
22
+ within three business days (and, typically, one business day). We may suggest
23
+ some changes or improvements or alternatives.
24
+
25
+ Some things that will increase the chance that your pull request is accepted:
26
+
27
+ * Write tests.
28
+ * Follow common [style guides][style].
29
+ * Write a [good commit message][commit].
30
+ * squash your commits before sending PR.
31
+
32
+ [style]: https://github.com/thoughtbot/guides/tree/master/style
33
+ [commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
data/Gemfile CHANGED
@@ -3,11 +3,13 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in valle.gemspec
4
4
  gemspec
5
5
 
6
- gem 'rails', '~> 4.0.0'
7
-
8
6
  gem 'rake'
9
- gem 'minitest'
10
- gem 'guard-minitest'
11
- gem 'turn'
12
- gem 'cucumber', '~> 1.0.0'
13
- gem 'aruba'
7
+
8
+ group :test do
9
+ gem 'rails', '~> 4.1.0'
10
+
11
+ gem 'minitest', '~> 5'
12
+ gem 'minitest-reporters'
13
+ gem 'cucumber'
14
+ gem 'aruba'
15
+ end
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 - 2013 Anton Kalyaev
1
+ Copyright (c) 2012 - 2014 Anton Kalyaev
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -88,12 +88,14 @@ There is a similar gem, called [validates_lengths_from_database](http://github.c
88
88
 
89
89
  ## Credits
90
90
 
91
- Team members:
91
+ Authors:
92
92
 
93
93
  - [Anton Kalyaev](http://github.com/akalyaev)
94
94
  - [Andrew Kulakov](http://github.com/Andrew8xx8)
95
95
  - [Alexander Kirillov](http://github.com/saratovsource)
96
96
 
97
+ Maintained by kaize team.
98
+
97
99
  Thank you to all our amazing [contributors](http://github.com/kaize/valle/contributors)!
98
100
 
99
101
  ## License
@@ -35,7 +35,7 @@ Feature:
35
35
  end
36
36
  """
37
37
  When I successfully run `bundle exec rake test --trace`
38
- Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors"
38
+ Then the output should contain "1 runs, 1 assertions, 0 failures, 0 errors"
39
39
 
40
40
  Scenario: Using the exclude_models option should skip the models specified in the list
41
41
  When I successfully run `bundle exec rails g model Post title:string`
@@ -76,7 +76,7 @@ Feature:
76
76
  end
77
77
  """
78
78
  When I successfully run `bundle exec rake test --trace`
79
- Then the output should contain "2 tests, 3 assertions, 0 failures, 0 errors"
79
+ Then the output should contain "2 runs, 3 assertions, 0 failures, 0 errors"
80
80
 
81
81
  Scenario: Using exclude_attributes option should allow us to skip some attributes
82
82
  When I write to "config/initializers/valle.rb" with:
@@ -103,4 +103,4 @@ Feature:
103
103
  end
104
104
  """
105
105
  When I successfully run `bundle exec rake test --trace`
106
- Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors"
106
+ Then the output should contain "1 runs, 1 assertions, 0 failures, 0 errors"
@@ -28,4 +28,4 @@ Feature: sets validations
28
28
  end
29
29
  """
30
30
  When I successfully run `bundle exec rake test --trace`
31
- Then the output should contain "1 tests, 2 assertions, 0 failures, 0 errors"
31
+ Then the output should contain "1 runs, 2 assertions, 0 failures, 0 errors"
@@ -50,9 +50,15 @@ module Valle
50
50
  # skip AR::SchemaMigration (AR >= 4.X)
51
51
  return false if (defined?(ActiveRecord::SchemaMigration) && subclass == ActiveRecord::SchemaMigration)
52
52
 
53
- Valle.can_process_model?(subclass.model_name) &&
54
- inherited_from_class == ActiveRecord::Base &&
55
- subclass.table_exists?
53
+ begin
54
+ model_name = subclass.model_name
55
+
56
+ Valle.can_process_model?(model_name) &&
57
+ inherited_from_class == ActiveRecord::Base &&
58
+ subclass.table_exists?
59
+ rescue ArgumentError
60
+ false
61
+ end
56
62
  end
57
63
  end
58
64
  end
@@ -1,3 +1,3 @@
1
1
  module Valle
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -3,21 +3,21 @@ require "test_helper"
3
3
  class CharacterLimitedColumnTest < TestCase
4
4
 
5
5
  def test_maximum_should_return_value_for_string_column
6
- original_column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "string(255)")
6
+ original_column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "varchar(255)")
7
7
  column = Valle::AbstractAdapter::CharacterLimitedColumn.new(original_column)
8
8
 
9
9
  assert column.maximum
10
10
  end
11
11
 
12
12
  def test_maximum_should_return_correct_value_for_string_column_if_user_redefine_limit
13
- original_column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "string(200)")
13
+ original_column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "varchar(200)")
14
14
  column = Valle::AbstractAdapter::CharacterLimitedColumn.new(original_column)
15
15
 
16
16
  assert_equal 200, column.maximum
17
17
  end
18
18
 
19
19
  def test_minimum_should_return_nil
20
- original_column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "string")
20
+ original_column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "varchar")
21
21
  column = Valle::AbstractAdapter::CharacterLimitedColumn.new(original_column)
22
22
 
23
23
  assert_nil column.minimum
@@ -4,7 +4,7 @@ require "active_record"
4
4
  class ColumnWrapperTest < TestCase
5
5
 
6
6
  def test_wrap_should_return_instance_of_character_limited_column_for_string_column
7
- column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "string")
7
+ column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "varchar(255)")
8
8
  wrapped_column = Valle::AbstractAdapter::ColumnWrapper.wrap(column)
9
9
 
10
10
  assert wrapped_column.is_a?(Valle::AbstractAdapter::CharacterLimitedColumn)
@@ -3,7 +3,9 @@ Bundler.require
3
3
 
4
4
  require "active_record"
5
5
 
6
- MiniTest::Unit.autorun
6
+ require 'minitest/autorun'
7
+ require "minitest/reporters"
8
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
7
9
 
8
- class TestCase < MiniTest::Unit::TestCase
10
+ class TestCase < MiniTest::Test
9
11
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.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: 2014-01-14 00:00:00.000000000 Z
11
+ date: 2014-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Valle automatically sets minimum and maximum values for the fields of
@@ -47,9 +47,10 @@ executables: []
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
- - .gitignore
51
- - .travis.yml
50
+ - ".gitignore"
51
+ - ".travis.yml"
52
52
  - CHANGELOG.md
53
+ - CONTRIBUTING.md
53
54
  - Gemfile
54
55
  - LICENSE
55
56
  - README.md
@@ -84,17 +85,17 @@ require_paths:
84
85
  - lib
85
86
  required_ruby_version: !ruby/object:Gem::Requirement
86
87
  requirements:
87
- - - '>='
88
+ - - ">="
88
89
  - !ruby/object:Gem::Version
89
90
  version: '0'
90
91
  required_rubygems_version: !ruby/object:Gem::Requirement
91
92
  requirements:
92
- - - '>='
93
+ - - ">="
93
94
  - !ruby/object:Gem::Version
94
95
  version: '0'
95
96
  requirements: []
96
97
  rubyforge_project:
97
- rubygems_version: 2.1.11
98
+ rubygems_version: 2.2.2
98
99
  signing_key:
99
100
  specification_version: 4
100
101
  summary: Built-in limit validations for your ActiveRecord model.