Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Rails 7.0 #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion active_presenter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Gem::Specification.new do |s|
'test/lint_test.rb',
'test/test_helper.rb'
]
s.add_runtime_dependency('activerecord', ['>= 3.2', '< 7.0'])
s.add_runtime_dependency('activerecord', ['>= 3.2', '< 8.0'])
s.add_development_dependency('rake', ['>= 12.0'])
s.add_development_dependency('rspec', ['>= 3.0.0'])
s.add_development_dependency('sqlite3', ['>= 1.3.5'])
Expand Down
8 changes: 4 additions & 4 deletions lib/active_presenter/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ def attribute_prefix(type)
end

def merge_errors(presented_inst, type)
presented_inst.errors.each do |att,msg|
if att == :base
errors.add(type, msg)
presented_inst.errors.each do |error|
if error.attribute == :base
errors.add(type, error.message)
else
errors.add(attribute_prefix(type)+att.to_s, msg)
errors.add(attribute_prefix(type) + error.attribute.to_s, error.message)
end
end
end
Expand Down