Module: ActiveRecordMask::ClassMethods

Defined in:
lib/active_record_mask/active_record_mask.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allowed_associationsObject (readonly)

Returns the value of attribute allowed_associations.



29
30
31
# File 'lib/active_record_mask/active_record_mask.rb', line 29

def allowed_associations
  @allowed_associations
end

#allowed_attributesObject (readonly)

Returns the value of attribute allowed_attributes.



29
30
31
# File 'lib/active_record_mask/active_record_mask.rb', line 29

def allowed_attributes
  @allowed_attributes
end

Instance Method Details

#allow_associations(value = nil) ⇒ Object



20
21
22
# File 'lib/active_record_mask/active_record_mask.rb', line 20

def allow_associations(value = nil)
  @allowed_associations = value if value
end

#allow_attributes(value = nil) ⇒ Object



16
17
18
# File 'lib/active_record_mask/active_record_mask.rb', line 16

def allow_attributes(value = nil)
  @allowed_attributes = value if value
end

#configure_active_record_mask {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



5
6
7
8
9
# File 'lib/active_record_mask/active_record_mask.rb', line 5

def configure_active_record_mask
  yield self if block_given?
  @allowed_attributes ||= [:id]
  @allowed_associations ||= []
end

#revealed_defaults(value = nil) ⇒ Object



11
12
13
14
# File 'lib/active_record_mask/active_record_mask.rb', line 11

def revealed_defaults(value = nil)
  @revealed_defaults = value if value
  @revealed_defaults ||= {}
end

#show_real_data_by_default(value = nil) ⇒ Object



24
25
26
27
# File 'lib/active_record_mask/active_record_mask.rb', line 24

def show_real_data_by_default(value = nil)
  @show_real_data_by_default = value if value
  @show_real_data_by_default ||= false
end