Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autoloading of inheriting records #397

Merged
merged 3 commits into from
Oct 16, 2020
Merged

Conversation

dimameshcharakou
Copy link
Contributor

@dimameshcharakou dimameshcharakou commented Oct 16, 2020

Description

The issue i faced during the update of LHS for location_app (some content was stripped on purpose):

# app/models/data_layer/favorites.rb

class DataLayer
  class ListType
    def build
      if favorites?
        'Favorites'
      end
    end
  end
end

such file will be loaded automatically when there is the following class: class Favorite < LHS::Record; end

This PR changes the regexp to more restrict and might match only the whole word(s).

P.S. Not sure how to test this behaviour since the file i put inside spec/dummy/app/models will be loaded when tests are executed.

@dimameshcharakou dimameshcharakou changed the title Autoload records fix Fix autoloading of inheriting records Oct 16, 2020
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module LHS
VERSION = '25.0.0'
VERSION = '25.1.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch 25.0.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ops - thanks 👍

@dimameshcharakou dimameshcharakou merged commit 2e71c96 into master Oct 16, 2020
@dimameshcharakou dimameshcharakou deleted the autoload-records-fix branch October 16, 2020 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants