David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
David Kimura PRO said over 7 years ago on Refactoring Models :
If by chance the token already exists then it will not generate the token. This probably would rarely happen on a small app with `SecureRandom.hex`, but on a larger table could be a concern. Another way to write it could be something like ``` def generate_token begin self.token = SecureRandom.hex end while self.class.exists?(token: token) end ```

David Kimura PRO said over 7 years ago on Refactoring Models :
Haha yes, good point. Sorry, I'm winding down for the night and obviously not thinking correctly.

David Kimura PRO said over 7 years ago on Non nested dynamic forms :
Do you have a use case in mind for this?

David Kimura PRO said over 7 years ago on Template for creating an application :
Great idea! Have you seen https://github.com/RailsApps/rails-composer from [Daniel Kehoe](https://twitter.com/rails_apps?lang=en)

David Kimura PRO said over 7 years ago on Deploying to AWS Elastic Beanstalk :
When you ssh into the EC2 instance, try doing this to get the database created. ``` sudo su bundle exec rails db:create exit ``` I believe they've changed the permissions of the ec2 user and you cannot login as the www user.