Module: Hippo::Concerns::ApiAttributeAccess::ClassMethods
- Includes:
- AccessChecks
- Defined in:
- lib/hippo/concerns/set_attribute_data.rb
Instance Method Summary
collapse
#can_delete_attributes?, #can_read_attributes?, #can_write_attributes?
Instance Method Details
#blacklist_attributes(*attributes) ⇒ Object
44
45
46
47
48
|
# File 'lib/hippo/concerns/set_attribute_data.rb', line 44
def blacklist_attributes( *attributes )
options = attributes.
self.blacklisted_attributes ||= DEFAULT_BLACKLISTED.clone
attributes.each{|attr| self.blacklisted_attributes[ attr.to_sym ] = options }
end
|
#from_attribute_data(data, user) ⇒ Object
50
51
52
53
54
|
# File 'lib/hippo/concerns/set_attribute_data.rb', line 50
def from_attribute_data(data,user)
record = self.new
record.set_attribute_data(data, user)
record
end
|
#whitelist_attributes(*attributes) ⇒ Object
37
38
39
40
41
|
# File 'lib/hippo/concerns/set_attribute_data.rb', line 37
def whitelist_attributes( *attributes )
options = attributes.
self.whitelisted_attributes ||= {}
attributes.each{|attr| self.whitelisted_attributes[ attr.to_sym ] = options }
end
|