Skip to content

Commit

Permalink
Register custom fields using explicit call to their class. This ensur…
Browse files Browse the repository at this point in the history
…es they are 'seen' by ActiveRecord whe autoloading (usually in development mode) is turned on.
  • Loading branch information
steveyken committed Aug 21, 2024
1 parent fd4afdc commit 8ac265f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fat_free_crm/custom_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
#
# Register CustomFields when Field class is loaded
ActiveSupport.on_load(:fat_free_crm_field) do # self == Field
register(as: 'date_pair', klass: 'CustomFieldDatePair', type: 'date')
register(as: 'datetime_pair', klass: 'CustomFieldDatetimePair', type: 'timestamp')
CustomFieldDatePair.register(as: 'date_pair', klass: 'CustomFieldDatePair', type: 'date')
CustomFieldDatetimePair.register(as: 'datetime_pair', klass: 'CustomFieldDatetimePair', type: 'timestamp')
end

0 comments on commit 8ac265f

Please sign in to comment.