lib/thingfish/metastore/pg/metadata.rb in thingfish-metastore-pg-0.2.0 vs lib/thingfish/metastore/pg/metadata.rb in thingfish-metastore-pg-0.3.0
- old
+ new
@@ -1,16 +1,16 @@
# -*- ruby -*-
-#encoding: utf-8
+# frozen_string_literal: true
require 'sequel/model'
require 'thingfish/mixins'
require 'thingfish/metastore/pg' unless defined?( Thingfish::Metastore::PG )
# A row of metadata describing an asset in a Thingfish store.
-class Thingfish::Metastore::PG::Metadata < Sequel::Model( :thingfish__metadata )
+class Thingfish::Metastore::PG::Metadata < Sequel::Model( :metadata )
include Thingfish::Normalization
# Allow instances to be created with a primary key
unrestrict_primary_key
@@ -145,9 +145,10 @@
protected
#########
### Proxy method -- fetch a value from the metadata hash if it exists.
def method_missing( sym, *args, &block )
+ return super if sym == :user_metadata
return self.user_metadata[ sym.to_s ] || super
end
end # Thingfish::Metastore::PG::Metadata