def save
obdata = {}
self.class.columns.each do |col|
- obdata[col.name.to_sym] = self.send(col.name.to_sym)
+ unless self.send(col.name.to_sym).nil? and !self.changed.include?(col.name)
+ obdata[col.name.to_sym] = self.send(col.name.to_sym)
+ end
end
obdata.delete :id
postdata = { self.class.to_s.underscore => obdata }
false
end
+ # can this class of object be copied into a project?
+ # override to false on indivudal model classes for which this should not be true
+ def self.copies_to_projects?
+ self.goes_in_projects?
+ end
+
def editable?
(current_user and current_user.is_active and
(current_user.is_admin or
current_user.uuid == self.owner_uuid or
new_record? or
- (writable_by.include? current_user.uuid rescue false)))
+ (writable_by.include? current_user.uuid rescue false))) or false
end
def attribute_editable?(attr, ever=nil)