module Lanes::Concerns::ApiAttributeAccess::ClassMethods

Public Instance Methods

blacklist_attributes( *attributes ) click to toggle source

@param attributes [Array of symbols] attributes that are not safe for the API to set

# File lib/lanes/concerns/set_attribute_data.rb, line 44
def blacklist_attributes( *attributes )
    options = attributes.extract_options!
    self.blacklisted_attributes ||= DEFAULT_BLACKLISTED.clone
    attributes.each{|attr| self.blacklisted_attributes[ attr.to_sym ] = options }
end
from_attribute_data(data,user) click to toggle source
# File lib/lanes/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 ) click to toggle source

@param attributes [Array of symbols] attributes that are safe for the API to set

# File lib/lanes/concerns/set_attribute_data.rb, line 37
def whitelist_attributes( *attributes )
    options = attributes.extract_options!
    self.whitelisted_attributes ||= {}
    attributes.each{|attr| self.whitelisted_attributes[ attr.to_sym ] = options }
end