Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
229 changes: 0 additions & 229 deletions .rubocop-https---onehq-com-rubocop3-yml

This file was deleted.

2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
inherit_from:
- https://onehq.com/rubocop3.yml
- https://onehq.com/rubocop3_4.yml
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1
3.4.4
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 2.6.3
ruby 3.4.4
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# HAS_VALIDATED_ATTRIBUTES

# Changelog

All notable changes to this project are documented in this file since Version 4 launched.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Guiding Principles

- Changelogs are for humans, not machines.
- There should be an entry for every single version.
- The same types of changes should be grouped.
- Versions and sections should be linkable.
- The latest version comes first.
- The release date of each version is displayed.
- Mention whether you follow Semantic Versioning.

### Types of changes

- **Added** for new features.
- **Changed** for changes in existing functionality.
- **Deprecated** for soon-to-be removed features.
- **Removed** for now removed features.
- **Fixed** for any bug fixes.
- **Security** in case of vulnerabilities.

## [5.0.0] 2025-12-01

### Added

- Main changelog file created.

### Changed

- Ruby version upgraded to 3.4.4
- In the gemspec file, allow to be used for Rails versions between 6.0 and 8.1.1.
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
# frozen_string_literal: true

source "https://rubygems.org"
source "https://vLEyAxzPMpJK8itRTFw6@gem.fury.io/onehq/"


source "https://vLEyAxzPMpJK8itRTFw6@gem.fury.io/onehq/" do
gem "has_normalized_attributes"
gem "testhq"
end

Expand Down
23 changes: 8 additions & 15 deletions has_validated_attributes.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require "has_validated_attributes/version"
Gem::Specification.new do |s|
s.name = "has_validated_attributes"
s.version = HasValidatedAttributes::VERSION
s.required_ruby_version = ">= 3.0.0"
s.required_ruby_version = ">= 3.4"
s.authors = ["Kyle Ginavan"]
s.date = "2010-05-18"
s.description = "has_validated_attributes is a Ruby on Rails gem that lets you validate your fields."
Expand All @@ -20,23 +20,16 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
s.homepage = "https://github.com/kylejginavan/has_validated_attributes"
s.require_paths = ["lib"]
s.rubygems_version = "1.5.2"
s.summary = "Ruby on Rails gem for validate data prior to save"
# s.rubyforge_project = "has_validated_attributes"

s.add_development_dependency "byebug", "~> 11.0"
s.add_development_dependency "combustion", "~> 1.1"
s.add_development_dependency "database_cleaner", "~> 1.7"
s.add_development_dependency "has_normalized_attributes", "~> 0.0", ">= 0.0.8"
s.add_development_dependency "rails", ">= 6.0", "<= 7.2.3"

s.add_development_dependency "ostruct", "~> 0.6"
s.add_development_dependency "pg", "~> 1.1"
s.add_development_dependency "rails", "~> 6.1"
s.add_development_dependency "rspec", "~> 3.8"
s.add_development_dependency "rspec_junit_formatter", "~> 0.4"
s.add_development_dependency "rspec-rails", ">= 4.0.0beta2", "< 5.0"
s.add_development_dependency "shoulda-matchers", "~> 4.1"
s.add_development_dependency "simplecov", "~> 0.17"
s.add_development_dependency "sprockets", "~> 3.0"

# test
s.add_development_dependency "testhq", "~> 2.0"
# hq
s.add_development_dependency "has_normalized_attributes", "~> 5.0.0.pre.beta.2"

s.add_development_dependency "testhq", "~> 5.0.0.pre.beta.3"
end
1 change: 0 additions & 1 deletion lib/has_validated_attributes.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true


require "active_record"

module HasValidatedAttributes
Expand Down
15 changes: 7 additions & 8 deletions lib/has_validated_attributes/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#{ e.path } is not loaded but is required when loading "has_validated_attributes/rspec"!

Do you need to `gem install #{ e.path }`?
ERROR_MSG
ERROR_MSG
end

Dir[Rails.root.join("spec/support/*.rb")].sort.each { |f| require f }
Expand Down Expand Up @@ -48,14 +48,14 @@ def method_missing(name, *args, &block)
].
select { |str| str.length <= length }.
each do |str|
it { should allow_value(str).for(attr) }
end
it { should allow_value(str).for(attr) }
end

["\e1B", "\cF", "Hello\nWorld", "\eHey", "Oh\cFNo, it's a control char!"].
select { |str| str.length <= length }.
each do |str|
it { should_not allow_value(str).for(attr).with_message(HasValidatedAttributes.name_format[:format][:message].call(nil, attribute: attr.to_s.humanize)) }
end
it { should_not allow_value(str).for(attr).with_message(HasValidatedAttributes.name_format[:format][:message].call(nil, attribute: attr.to_s.humanize)) }
end
end

RSpec.shared_examples_for "username attribute" do |attr|
Expand Down Expand Up @@ -204,7 +204,6 @@ def method_missing(name, *args, &block)
it { should allow_value(value).for(attr) }
end


["111", "-1", "abc", "&"].each do |value|
it { should_not allow_value(value).for(attr).with_message(HasValidatedAttributes.age_format[:numericality][:message]) }
end
Expand Down Expand Up @@ -235,7 +234,7 @@ def method_missing(name, *args, &block)

[
"1,000,00", "$1,000.00", "1,000,000", "1 000 000.01",
"-1,000,00", "-$1,000.00", "-1,000,000", "-1 000 000.01" # has_normalized_attributes may be used in concert with has_validated_attributes to cover these cases.
"-1,000,00", "-$1,000.00", "-1,000,000", "-1 000 000.01" # has_normalized_attributes may be used in concert with has_validated_attributes to cover these cases.
].each do |value|
it { send(normalized ? :should : :should_not, allow_value(value).for(attr)) }
end
Expand All @@ -251,7 +250,7 @@ def method_missing(name, *args, &block)
end

[
"1,000,00", "1,000.00", "1,000,000", "1 000 000", # has_normalized_attributes may be used in concert with has_validated_attributes to cover these cases.
"1,000,00", "1,000.00", "1,000,000", "1 000 000", # has_normalized_attributes may be used in concert with has_validated_attributes to cover these cases.
].each do |value|
it { send(normalized ? :should : :should_not, allow_value(value).for(attr).with_message(HasValidatedAttributes.number_format[:numericality][:message])) }
end
Expand Down
Loading