Skip to content

Commit

Permalink
Use new #account_from_id in generated mailer
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Jul 23, 2024
1 parent 4984b8d commit e6fb7ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class RodauthMailer < ApplicationMailer
# ad-hoc by modifying the `rodauth.rails_url_options` hash.
def rodauth(name, account_id, &block)
instance = RodauthApp.rodauth(name).allocate
instance.instance_eval { @account = account_ds(account_id).first! }
instance.account_from_id(account_id)
instance.instance_eval(&block) if block
instance
end
Expand Down
2 changes: 1 addition & 1 deletion rodauth-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "railties", ">= 5.0", "< 8"
spec.add_dependency "rodauth", "~> 2.34"
spec.add_dependency "rodauth", "~> 2.36"
spec.add_dependency "roda", "~> 3.76"
spec.add_dependency "sequel-activerecord_connection", "~> 1.1"
spec.add_dependency "rodauth-model", "~> 0.2"
Expand Down
4 changes: 2 additions & 2 deletions test/rodauth_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ class RodauthTest < UnitTest
assert_equal account, Rodauth::Rails.rodauth(account_id: account.id).rails_account

rodauth = RodauthApp.rodauth.allocate
rodauth.instance_eval { @account = account_ds(account.id).first! }
rodauth.account_from_id(account.id)
assert_equal account, rodauth.rails_account

account2 = Account.create!(email: "user2@example.com", status: "verified")
rodauth.instance_eval { @account = account_ds(account2.id).first! }
rodauth.account_from_id(account2.id)
assert_equal account2, rodauth.rails_account
end

Expand Down

0 comments on commit e6fb7ba

Please sign in to comment.