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

Add configuration for JSON column type #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/rails-settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ def self.has_settings(*args, &block)
extend RailsSettings::Scopes
end
end

4 changes: 3 additions & 1 deletion lib/rails-settings/setting_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class SettingObject < ActiveRecord::Base
end
end

serialize :value, Hash
if self.columns_hash['value'].type.to_sym == :text
serialize :value, Hash
end

if RailsSettings.can_protect_attributes?
# attr_protected can not be used here because it touches the database which is not connected yet.
Expand Down