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

Fix custom field error #1190

Merged
merged 2 commits into from
Oct 28, 2023
Merged

Fix custom field error #1190

merged 2 commits into from
Oct 28, 2023

Conversation

steveyken
Copy link
Member

With a base installation of Fat Free CRM, creating a Custom Field generates the following error:

ArgumentError (wrong number of arguments (given 4, expected 3)):

app/models/fields/custom_field.rb:127:in `add_column'
app/controllers/admin/fields_controller.rb:50:in `create'

This PR fixes that by bringing the add_column usage into line with recent changes in Rails.

@steveyken steveyken requested a review from CloCkWeRX October 28, 2023 03:50
@@ -42,6 +42,19 @@
field_group: create(:field_group, klass_name: "Contact"))
end

it "should add a column to the database and include column_options" do
expect(CustomField.connection).to receive(:add_column)
.with("contacts", "cf_test_field", 'decimal', {"precision" => 15, "scale" => 2})

Check notice

Code scanning / Rubocop

Use spaces inside hash literal braces - or don't. Note test

Layout/SpaceInsideHashLiteralBraces: Space inside { missing.
@@ -42,6 +42,19 @@
field_group: create(:field_group, klass_name: "Contact"))
end

it "should add a column to the database and include column_options" do
expect(CustomField.connection).to receive(:add_column)
.with("contacts", "cf_test_field", 'decimal', {"precision" => 15, "scale" => 2})

Check notice

Code scanning / Rubocop

Use spaces inside hash literal braces - or don't. Note test

Layout/SpaceInsideHashLiteralBraces: Space inside } missing.
@CloCkWeRX CloCkWeRX merged commit 3e4ab48 into master Oct 28, 2023
8 checks passed
@CloCkWeRX CloCkWeRX deleted the fix-custom-field branch October 28, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants