Skip to content

Commit

Permalink
Merge pull request #207 from team-florence/improve-rails-7-2-compatib…
Browse files Browse the repository at this point in the history
…ility

Improve Rails 7.2 compatibility
  • Loading branch information
dejan authored Nov 11, 2024
2 parents 4d605eb + d88fabf commit 2fb30a5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
36 changes: 36 additions & 0 deletions meta_request/Dockerfile-rails-7.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ruby:3.1-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.2.1.1
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"]
8 changes: 8 additions & 0 deletions meta_request/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ services:
build:
context: .
dockerfile: Dockerfile-rails-7.0
test-rails-7.1:
build:
context: .
dockerfile: Dockerfile-rails-7.1
test-rails-7.2:
build:
context: .
dockerfile: Dockerfile-rails-7.2
1 change: 1 addition & 0 deletions meta_request/lib/meta_request/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def sanitize_hash(payload)

def not_encodable?(value)
return true if defined?(ActiveRecord) && value.is_a?(ActiveRecord::ConnectionAdapters::AbstractAdapter)
return true if defined?(ActiveRecord) && defined?(ActiveRecord::Transaction) && value.is_a?(ActiveRecord::Transaction)
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)

Expand Down

0 comments on commit 2fb30a5

Please sign in to comment.