-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Can models reference the default value in a schema when they are created using the new keyword? #912
Comments
I have been going through the plugins and found These seams to describe what I want but I can't get it to work. I am using padrino and have added the plugin with the other plugin declarations /config/database.rb Sequel::Model.plugin(:schema)
Sequel::Model.plugin :defaults_setter
Sequel::Model.raise_on_save_failure = false # Do not throw exceptions on failure
Sequel::Model.db = case Padrino.env
when :development then Sequel.connect("postgres://localhost/commentr_development", :loggers => [logger])
when :production then Sequel.connect("postgres://localhost/commentr_production", :loggers => [logger])
when :test then Sequel.connect("postgres://localhost/commentr_test", :loggers => [logger])
end
Sequel::Model.db.extension :pg_array |
You don't describe how it isn't working for you. When submitting a bug report, you should provide a self-contained, reproducible example showing the problem. Using your example, it seems to be fine here:
Note that as the contributions guidelines state, GitHub Issues should not be used as a help form, only for reporting bugs. Please use IRC or the sequel-talk Google Group if you need help using Sequel. |
Thanks for the input. I will look through as to where the error has come from. I will use one of the mentioned channels in future. As a further note. The documentation to this project is some of the best I have found. However its comprehensive nature is quite intimidating to a reasonably recent newcomer. Even the list of further resources on the README suggests five more places to get help. Google group doesn't stand out as the place to get help unless you know that and I see no mention of IRC. perhaps a section along the line of 'Questions? please use the refer to the google group' Because some repos have quite active discussions in their issue section. |
I think you are right, it makes sense to make things more explicit in the README, since that is the first place people are going to look. I'll take care of that. |
This was mentioned in a few other places, but it makes sense to have it in the README.
This is a migration from the project I am currently working on
I want to get the same behavior for articles created new as for ones pulled from the database
Admittedly in this case false vs nil is not a deal breaker but would be a very different situation for nearly any other default case
The text was updated successfully, but these errors were encountered: