Skip to content

Commit

Permalink
Fix enum parsing problems
Browse files Browse the repository at this point in the history
  • Loading branch information
nickcharlton committed Nov 13, 2024
1 parent 2235b02 commit 69cca8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions spec/example_app/app/models/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ class Customer < ApplicationRecord
validates :name, presence: true
validates :email, presence: true

KINDS = {
"standard" => "kind:std",
"vip" => "kind:vip"
}.freeze
enum kind: KINDS
enum :kind, {"standard" => "kind:std", "vip" => "kind:vip"}

def admin?
false
Expand Down
4 changes: 2 additions & 2 deletions spec/generators/dashboard_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class InventoryItem < Administrate::Generators::TestRecord
end

class Shipment < Administrate::Generators::TestRecord
enum status: %i[ready processing shipped]
enum :status, %i[ready processing shipped]
reset_column_information
end

Expand All @@ -161,7 +161,7 @@ class Shipment < Administrate::Generators::TestRecord
end

class Shipment < Administrate::Generators::TestRecord
enum status: %i[ready processing shipped]
enum :status, %i[ready processing shipped]
reset_column_information
end

Expand Down

0 comments on commit 69cca8f

Please sign in to comment.