We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When LHS is used to access a text attribute that starts with a date or datetime, it converts the initial date ignoring everything else.
Sample json:
[ { "id": 1, "text": "2021-10-28 Sample message." } ]
Accessing text attribute returns a date and not an string:
[1] > ticket = Ticket.where(id: 1) => Ticket 47342870532040 {:id=>1, :text=>"2021-10-28 Sample message."} [2] > ticket.first.text => Thu, 28 Oct 2021
The issue seems to be caused by the regex in:
lhs/lib/lhs/concerns/proxy/accessors.rb
Line 125 in c6f7c62
Limiting it with \A and \z seems to fix the problem without any side effects:
def date_time_regex /\A(?<date>\d{4}-\d{2}-\d{2})?(?<time>T\d{2}:\d{2}(:\d{2}(\.\d*.\d{2}:\d{2})*)?)?\z/ end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When LHS is used to access a text attribute that starts with a date or datetime, it converts the initial date ignoring everything else.
Sample json:
Accessing text attribute returns a date and not an string:
The issue seems to be caused by the regex in:
lhs/lib/lhs/concerns/proxy/accessors.rb
Line 125 in c6f7c62
Limiting it with \A and \z seems to fix the problem without any side effects:
The text was updated successfully, but these errors were encountered: