Skip to content

v0.8.0

Compare
Choose a tag to compare
@Manfred Manfred released this 07 Jul 10:53
· 67 commits to main since this release
c7bbdd1
  • Property values from a payload are now stored as a Hash in the model instance to support multiple access methods.
  • Added an inflector so properties which don't use snake_case like firstName can now be accessed through the first_name method.
  • Added a way to register irregular snake-cases with the inflector, for example: reynard.snake_cases({ '1st-class' => 'first_class' }). This particular example allows the 1st-class property on a model to be accessed through the first_class method. See the README for more examples and details.

Upgrade notes

It's possible that Reynard now throws a NoMethodError where it previously returned nil, this may be caused by the fact that the payload is missing an optional value. You can either use try(:method_name) in Ruby on Rails, check if the attribute is accessible with respond_to?(:method_name) or use the [] accessor ["method_name"], note that you probably have to use a string in the last example.