-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc(tresholds): Rename progressive_billing_tresholds to usage_tresho…
…lds (#2379) ## Roadmap Task 👉 https://getlago.canny.io/feature-requests/p/progressive-billing ## Description Rename `progressive_billing_tresholds` to `usage_tresholds`: - table - models - serializers
- Loading branch information
1 parent
8bbc04e
commit a393b74
Showing
13 changed files
with
79 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/models/progressive_billing_treshold.rb → app/models/usage_treshold.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rogressive_billing_treshold_serializer.rb → ...rializers/v1/usage_treshold_serializer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
db/migrate/20240807072052_rename_progressive_billing_tresholds.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class RenameProgressiveBillingTresholds < ActiveRecord::Migration[7.1] | ||
def change | ||
rename_table :progressive_billing_tresholds, :usage_tresholds | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...actories/progressive_billing_tresholds.rb → spec/factories/usage_tresholds.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
spec/serializers/v1/progressive_billing_treshold_serializer_spec.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe ::V1::UsageTresholdSerializer do | ||
subject(:serializer) { described_class.new(usage_treshold, root_name: 'usage_treshold') } | ||
|
||
let(:usage_treshold) { create(:usage_treshold) } | ||
|
||
it 'serializes the object' do | ||
result = JSON.parse(serializer.to_json) | ||
|
||
aggregate_failures do | ||
expect(result['usage_treshold']).to include( | ||
'lago_id' => usage_treshold.id, | ||
'treshold_display_name' => usage_treshold.treshold_display_name, | ||
'amount_cents' => usage_treshold.amount_cents, | ||
'amount_currency' => usage_treshold.amount_currency, | ||
'recurring' => usage_treshold.recurring?, | ||
'created_at' => usage_treshold.created_at.iso8601, | ||
'updated_at' => usage_treshold.updated_at.iso8601 | ||
) | ||
end | ||
end | ||
end |