Module: Lanes::Concerns::ApiAttributeAccess::ClassMethods
- Includes:
- AccessChecks
- Defined in:
- lib/lanes/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
43
44
45
46
47
|
# File 'lib/lanes/concerns/set_attribute_data.rb', line 43
def blacklist_attributes( *attributes )
options = attributes.
self.blacklisted_attributes ||= {}
attributes.each{|attr| self.blacklisted_attributes[ attr.to_sym ] = options }
end
|
#from_attribute_data(data, user) ⇒ Object
49
50
51
52
53
|
# File 'lib/lanes/concerns/set_attribute_data.rb', line 49
def from_attribute_data(data,user)
record = self.new
record.set_attribute_data(data, user)
record
end
|
#whitelist_attributes(*attributes) ⇒ Object
36
37
38
39
40
|
# File 'lib/lanes/concerns/set_attribute_data.rb', line 36
def whitelist_attributes( *attributes )
options = attributes.
self.whitelisted_attributes ||= {}
attributes.each{|attr| self.whitelisted_attributes[ attr.to_sym ] = options }
end
|