Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Rails4 Model.find() fix #384
This pull request fixes a few deprecation warnings during the tests plus re-enables
irb(main):003:0> Job.find 'ad' Job Load (0.4ms) SELECT `jobs`.* FROM `jobs` WHERE `jobs`.`slug` = 'ad' ORDER BY `jobs`.`id` ASC LIMIT 1 # => <Job id: 16 ... > irb(main):004:0> Job.find 'not-there' Job Load (0.4ms) SELECT `jobs`.* FROM `jobs` WHERE `jobs`.`slug` = 'not-there' ORDER BY `jobs`.`id` ASC LIMIT 1 Job Load (0.3ms) SELECT `jobs`.* FROM `jobs` WHERE `jobs`.`id` = 0 LIMIT 1 ActiveRecord::RecordNotFound: Couldn't find Job with id=not-there
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
As mentioned above my pull request isn't merged yet since it's not fixing all issues, especially stuff that is related to globalize, which I couldn't figure out yet. If you need the find magic specifically, you can use my branch if you want:
gem 'friendly_id', github: 'mbehrendt/friendly_id', branch: :rails4