Skip to content

Commit 93f0a20

Browse files
authored
Merge pull request #199 from grnhse/rails-7-1-form-builder-incompatibility
Rails 7.1 Incompatibility: Exclude Payload Locals
2 parents 540716e + 3325276 commit 93f0a20

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

meta_request/Dockerfile-rails-7.1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM ruby:3.0-alpine
2+
3+
RUN apk add --update --no-cache \
4+
build-base \
5+
curl-dev \
6+
git \
7+
nodejs \
8+
shared-mime-info \
9+
sqlite-dev \
10+
tzdata \
11+
yaml-dev \
12+
yarn \
13+
zlib-dev
14+
15+
RUN mkdir /app /gem
16+
WORKDIR /app
17+
18+
RUN gem update --system 3.5.7
19+
RUN bundle config force_ruby_platform true
20+
RUN gem install rails -v 7.1.3.2
21+
RUN rails new .
22+
23+
COPY . /gem
24+
RUN bundle add meta_request --path /gem
25+
RUN bundle install
26+
27+
COPY res/routes.rb /app/config/
28+
COPY res/dummy_controller.rb /app/app/controllers/
29+
COPY res/dummy /app/app/views/dummy
30+
COPY res/meta_request_test.rb /app/test/integration/
31+
32+
RUN bundle exec rails db:migrate
33+
34+
ENV PARALLEL_WORKERS 1
35+
36+
CMD ["bin/rake"]

meta_request/lib/meta_request/event.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ def sanitize_hash(payload)
6161
payload[:key] = ActiveSupport::Cache::Store.new.send(:normalize_key, payload[:key])
6262
end
6363

64-
payload
64+
payload.except(:locals)
6565
end
6666

6767
def not_encodable?(value)
68-
(defined?(ActiveRecord) && value.is_a?(ActiveRecord::ConnectionAdapters::AbstractAdapter)) ||
69-
(defined?(ActionDispatch) &&
70-
(value.is_a?(ActionDispatch::Request) || value.is_a?(ActionDispatch::Response)))
68+
return true if defined?(ActiveRecord) && value.is_a?(ActiveRecord::ConnectionAdapters::AbstractAdapter)
69+
return true if defined?(ActionDispatch) && (value.is_a?(ActionDispatch::Request) || value.is_a?(ActionDispatch::Response))
70+
return true if defined?(ActionView) && value.is_a?(ActionView::Helpers::FormBuilder)
71+
72+
false
7173
end
7274

7375
# https://gist.github.com/dbenhur/1070399

meta_request/meta_request.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |gem|
44
gem.name = 'meta_request'
5-
gem.version = '0.8.2'
5+
gem.version = '0.8.3'
66

77
gem.summary = 'Request your Rails request'
88
gem.description = 'Supporting gem for Rails Panel (Google Chrome extension for Rails development)'

0 commit comments

Comments
 (0)