projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 3836-remove-collection-from-project-bug
[arvados.git]
/
apps
/
workbench
/
app
/
models
/
arvados_base.rb
diff --git
a/apps/workbench/app/models/arvados_base.rb
b/apps/workbench/app/models/arvados_base.rb
index c0e670dcefe65b6e0aa4d053b7c07cbf432813bb..b691e6d2bafefaf42c13b9e27711de76f7404cd9 100644
(file)
--- a/
apps/workbench/app/models/arvados_base.rb
+++ b/
apps/workbench/app/models/arvados_base.rb
@@
-167,7
+167,9
@@
class ArvadosBase < ActiveRecord::Base
def save
obdata = {}
self.class.columns.each do |col|
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 }
end
obdata.delete :id
postdata = { self.class.to_s.underscore => obdata }
@@
-303,6
+305,11
@@
class ArvadosBase < ActiveRecord::Base
self.to_s.underscore.humanize
end
self.to_s.underscore.humanize
end
+ # Array of strings that are names of attributes that should be rendered as textile.
+ def textile_attributes
+ []
+ end
+
def self.creatable?
current_user
end
def self.creatable?
current_user
end
@@
-311,12
+318,18
@@
class ArvadosBase < ActiveRecord::Base
false
end
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
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)
end
def attribute_editable?(attr, ever=nil)