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

Don't need to serialize in rails4 #1

Open
wants to merge 3 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
3 changes: 1 addition & 2 deletions activerecord-hstore_properties.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency "rspec"
gem.add_development_dependency "sqlite3"
gem.add_development_dependency "activerecord", '>= 3.2.12'
gem.add_development_dependency "with_model"
gem.add_development_dependency "with_model", "~> 0.3.1"
gem.add_development_dependency "pry"

end
end
3 changes: 1 addition & 2 deletions lib/active_record/hstore_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module HstoreProperties
extend ActiveSupport::Concern

included do
serialize :properties, ::ActiveRecord::Coders::Hstore
class_attribute :_properties
end

Expand Down Expand Up @@ -77,4 +76,4 @@ def extract_properties(args)
end
end
end
end
end
4 changes: 2 additions & 2 deletions lib/active_record/properties/boolean_property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def formtastic_options
end

add_property_accessor '_enabled?', '?' do |property|
::ActiveRecord::ConnectionAdapters::Column.value_to_boolean(properties[property.name.to_s])
ActiveRecord::Type::Boolean.new.type_cast_from_database(properties[property.name.to_s])
end

add_property_accessor '_raise!', '_enable!' do |property|
Expand All @@ -26,4 +26,4 @@ def formtastic_options
end
end
end
end
end