Added spec for datetime field#2426
Closed
billguy wants to merge 2 commits into
Closed
Conversation
Contributor
|
I also noticed a wrong behaviour in datetime management, but I didn't take a deeper look |
Contributor
Contributor
|
Add to your application.rb config.time_zone = 'Rome'Model: # Schema
create_table "players", force: :cascade do |t|
t.string "name"
t.integer "team_id"
t.datetime "birthday"
end
# Player.rb
class Player < ActiveRecord::Base
validates :name, presence: true
end
# Rails admin config
config.model Player do
field :name
field :birthday
endUsing master branch: open an existing object, save, date will be increased by 2 hours each save Using the gem version 0.7.0: everything is fine Tried to bisect, here are the results: |
Contributor
|
@dalpo any news on this one? Unfortunately I can't take a deeper look by myself at the moment |
Contributor
|
I found the issue! I hope to fix it and make a PR this weekend. |
Contributor
|
Great news, thanks! |
dalpo
pushed a commit
to dalpo/rails_admin
that referenced
this pull request
Nov 3, 2015
dalpo
pushed a commit
to dalpo/rails_admin
that referenced
this pull request
Nov 11, 2015
dalpo
pushed a commit
to dalpo/rails_admin
that referenced
this pull request
Nov 12, 2015
Contributor
|
This PR can be closed by #2448 |
Contributor
|
@dalpo thanks! I can confirm that #2426 (comment) is not an issue anymore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rails 4.2.3
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
OSX 10.11
It seems after v0.6.8 that when a custom Rails config.time_zone is used and you save a datetime field without altering it, RailsAdmin appears to mutate the value of the field. I'm not certain why this is happening. It does appear to work correctly when config.time_zone is not set.