Skip to content

Commit

Permalink
Deprecate ActiveScaffold.js_framework as will be removed in 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Nov 21, 2024
1 parent 6241142 commit cf8daa5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Add hidden field with locking column in base_form partial for persisted records automatically, if model uses optimistic locking.
- Add on_stale_object_error when StaleObjectError is rescued, to allow customization.
- Fix search_ui :select_multiple, which was broken when operator select was added.
- Deprecate ActiveScaffold.js_framework as will be removed in 4.0

= 3.7.8
- Rollback previous behaviour when submitting empty values, broken when default_value was added. Default value set in column is not used when trying to save empty value, DB default is used in that case, and save NULL when string is empty, as before.
Expand Down
14 changes: 13 additions & 1 deletion lib/active_scaffold.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,19 @@ def self.threadsafe!
@@threadsafe = true
end

mattr_writer :js_framework, instance_writer: false
def self.js_framework=(framework)
warning = 'js_framework is deprecated as prototype support will be removed in 4.0'
case framework
when :jquery then
if defined? Jquery
warning += ', it can be removed as it defaults to :jquery'
else
warning += ", it's still needed in this version, as you are not using jquery-rails gem"
end
when :prototype then ', convert your app to jQuery, and remove this call'
ActiveSupport::Deprecation.warn warning
@@js_framework = framework
end
def self.js_framework
@@js_framework ||=
if defined? Jquery
Expand Down

0 comments on commit cf8daa5

Please sign in to comment.