Class: Storey::Hstore
- Inherits:
-
Object
- Object
- Storey::Hstore
- Defined in:
- lib/storey/hstore.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.install ⇒ Object
4 5 6 |
# File 'lib/storey/hstore.rb', line 4 def self.install self.new.install end |
Instance Method Details
#install ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/storey/hstore.rb', line 8 def install ensure_hstore_is_persistent Storey.create 'hstore', force: true ::ActiveRecord::Base.connection.execute "CREATE EXTENSION IF NOT EXISTS hstore SCHEMA #{suffixify('hstore')}" rescue ::ActiveRecord::StatementInvalid => e if e. =~ /could not open extension control file/ fail StoreyError, "Oops! Looks like the Hstore extension is not installed. Please install it for your OS first." end fail e end |