Skip to content

Commit

Permalink
Merge pull request #199 from grnhse/rails-7-1-form-builder-incompatib…
Browse files Browse the repository at this point in the history
…ility

Rails 7.1 Incompatibility: Exclude Payload Locals
  • Loading branch information
dejan authored Sep 2, 2024
2 parents 540716e + 3325276 commit 93f0a20
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
36 changes: 36 additions & 0 deletions meta_request/Dockerfile-rails-7.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ruby:3.0-alpine

RUN apk add --update --no-cache \
build-base \
curl-dev \
git \
nodejs \
shared-mime-info \
sqlite-dev \
tzdata \
yaml-dev \
yarn \
zlib-dev

RUN mkdir /app /gem
WORKDIR /app

RUN gem update --system 3.5.7
RUN bundle config force_ruby_platform true
RUN gem install rails -v 7.1.3.2
RUN rails new .

COPY . /gem
RUN bundle add meta_request --path /gem
RUN bundle install

COPY res/routes.rb /app/config/
COPY res/dummy_controller.rb /app/app/controllers/
COPY res/dummy /app/app/views/dummy
COPY res/meta_request_test.rb /app/test/integration/

RUN bundle exec rails db:migrate

ENV PARALLEL_WORKERS 1

CMD ["bin/rake"]
10 changes: 6 additions & 4 deletions meta_request/lib/meta_request/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ def sanitize_hash(payload)
payload[:key] = ActiveSupport::Cache::Store.new.send(:normalize_key, payload[:key])
end

payload
payload.except(:locals)
end

def not_encodable?(value)
(defined?(ActiveRecord) && value.is_a?(ActiveRecord::ConnectionAdapters::AbstractAdapter)) ||
(defined?(ActionDispatch) &&
(value.is_a?(ActionDispatch::Request) || value.is_a?(ActionDispatch::Response)))
return true if defined?(ActiveRecord) && value.is_a?(ActiveRecord::ConnectionAdapters::AbstractAdapter)
return true if defined?(ActionDispatch) && (value.is_a?(ActionDispatch::Request) || value.is_a?(ActionDispatch::Response))
return true if defined?(ActionView) && value.is_a?(ActionView::Helpers::FormBuilder)

false
end

# https://gist.github.com/dbenhur/1070399
Expand Down
2 changes: 1 addition & 1 deletion meta_request/meta_request.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |gem|
gem.name = 'meta_request'
gem.version = '0.8.2'
gem.version = '0.8.3'

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

0 comments on commit 93f0a20

Please sign in to comment.