Skip to content

Commit 103ccb9

Browse files
committed
fixed unparser issue
1 parent 8004e89 commit 103ccb9

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

change-log.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 1.4alpha - 2019-02-15
8+
### Security
9+
+ [#117](https://github.com/hyperstack-org/hyperstack/issues/117) Finder methods will return nil instead of raising access violations.
10+
11+
### Added
12+
+ [#120](https://github.com/hyperstack-org/hyperstack/issues/120) Alias `ActiveRecord::Base#new_record?` to `#new?`.
13+
+ [#112](https://github.com/hyperstack-org/hyperstack/issues/112) Add `:init` param to `INPUT`, `SELECT`, and `TEXTAREA` tags.
14+
715
## 1.3alpha - 2019-01-16
816
### Security
917
+ [#102](https://github.com/hyperstack-org/hyperstack/issues/102) Security hole in find_record method filled.

ruby/hyper-model/spec/batch1/column_types/column_type_spec.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,21 @@ class DefaultTest < ActiveRecord::Base
239239
end
240240

241241
it 'converts a 0, "false" false and nil to a boolean false, everything else is true' do
242+
# there is a bug someplace (unparser probably) that is is treating the empty array as nil
243+
# but ONLY if it is the normal ruby block (not a string) AND if you use a normal arg
244+
# instead of *args. In other words put that same expression in a string and change
245+
# *args/args.first to plain old arg and it works fine.
242246
expect_evaluate_ruby do
247+
[0, 'false', false, nil, 'hi', 17, [], true].collect do |*args|
248+
TypeTest.new(boolean: args.first).boolean
249+
end
250+
end.to eq([false, false, false, false, true, true, true, true])
251+
252+
expect_evaluate_ruby("
243253
[0, 'false', false, nil, 'hi', 17, [], true].collect do |val|
244254
TypeTest.new(boolean: val).boolean
245255
end
246-
end.to eq([false, false, false, false, true, true, true, true])
256+
").to eq([false, false, false, false, true, true, true, true])
247257
check_errors
248258
end
249259

0 commit comments

Comments
 (0)