Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Postgres HStore column serialization for your ActiveRecord / Rails 3.1+ project.

License

Notifications You must be signed in to change notification settings

ruckus/active_record_hstore_serializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enable Postgres HStore column serialization for your ActiveRecord / Rails 3.1+ project.

Huge thanks and credit to https://github.com/softa/activerecord-postgres-hstore for code and inspiration.

Example

class Car < ActiveRecord::Base
  serialize :data, HstoreSerializer
end

toyota = Car.create(:data => {:doors => 2, :color => "grey"})

# Finding. Notice that all values get stored as strings, hence the typecasting
Car.where(["data -> 'doors' = ?", "2"])

# Updating / Inserting
car.data['make'] = "Toyota"
car.save

About

Postgres HStore column serialization for your ActiveRecord / Rails 3.1+ project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages