lib/spontaneous/field/base.rb in spontaneous-0.2.0.beta9 vs lib/spontaneous/field/base.rb in spontaneous-0.2.0.beta10
- old
+ new
@@ -51,10 +51,16 @@
# Provides the ability for specific field types to customize the schema values
# they return to the UI
def export(user)
{}
end
+
+ # Allows for field type classes to map a human readable default value
+ # to the correct serialized value
+ def make_default_value(instance, value)
+ value
+ end
end
extend ClassMethods
include Spontaneous::Model::Core::ContentHash::FieldMethods
@@ -376,9 +382,13 @@
self.prototype.schema_name
end
def schema_owner
self.prototype.owner
+ end
+
+ def site
+ owner.try(:site)
end
def owner_sid
schema_owner.schema_id
end