Skip to content

Instantly share code, notes, and snippets.

@jacoyutorius
Last active April 1, 2017 04:56
Show Gist options
  • Save jacoyutorius/5368883 to your computer and use it in GitHub Desktop.
Save jacoyutorius/5368883 to your computer and use it in GitHub Desktop.
Railsで既存のテーブルをModelとして使用する ref: http://qiita.com/jacoyutorius/items/86691266b63f967f47d3
$rails g model hogehoge
> hogeid = Hogehoge.find("hogeid")
class Hogehoge < ActiveRecord::Base
set_table_name :hogehoge
set_primary_key :hogeid
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment