I've seen several models define a static method
self.base_attributes
{
:object => []
}
end
and some other models define the static method
self.attributes
@@attributes = {}
end
What exactly is the difference between attributes and base attributes?
Well in your example without knowing more about the code, the self.attributes
method is using a class variable (@@attributes
), which means that you could add more attributes to it at run time.
Where as your base_attributes
is hard coded. I suspect you're seeing something like:
base_attributes.merge(attributes)
which is a way of defining default values perhaps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With