- A
- C
- F
- I
- R
- U
- W
FIXME: Include counter caches as well
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 41 def automatic_properties 42 [identifier_property] + send(:all_timestamp_attributes_in_model) 43 end
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 26 def creatable_properties 27 writeable_properties 28 end
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 45 def foreign_key_properties 46 reflect_on_all_associations(:belongs_to).map(&:foreign_key).map(&:to_s) 47 end
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 14 def identifier_property 15 primary_key 16 end
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 18 def readable_properties 19 props = attribute_names - foreign_key_properties 20 21 props.concat(reference_properties) 22 23 props.map(&:to_s) 24 end
rubocop:todo Style/OptionalBooleanParameter
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 50 def reference_properties(read = true) 51 references.map do |r| 52 sym = reference_to_sym(r) 53 54 # All references are readable 55 next sym if read 56 57 # Writeable if a one type or accepting nested 58 association = reflect_on_association(sym) 59 # rubocop:todo Performance/CollectionLiteralInLoop, Layout/LineLength 60 if %i[has_one belongs_to].include?(association.macro) || nested_attributes_options.key?(sym) || association.class_name == "ActiveStorage::Attachment" 61 sym 62 end 63 # rubocop:enable Performance/CollectionLiteralInLoop, Layout/LineLength 64 end.compact 65 end
FIXME: Duplicated in params.rb
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 36 def reference_to_sym(reference) 37 reference.is_a?(Hash) ? reference.keys.first : reference 38 end
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 30 def updatable_properties 31 writeable_properties 32 end
rubocop:enable Style/OptionalBooleanParameter
Source: show
# File rhino/rhino/lib/rhino/resource/active_record_extension/properties.rb 68 def writeable_properties 69 # Direct properties for this model 70 props = attribute_names - automatic_properties - foreign_key_properties 71 72 props.concat(reference_properties(false)) 73 74 props.map(&:to_s) 75 end