{"action":"closed","issue":{"url":"https://api.github.com/repos/diesel-rs/diesel/issues/389","repository_url":"https://api.github.com/repos/diesel-rs/diesel","labels_url":"https://api.github.com/repos/diesel-rs/diesel/issues/389/labels{/name}","comments_url":"https://api.github.com/repos/diesel-rs/diesel/issues/389/comments","events_url":"https://api.github.com/repos/diesel-rs/diesel/issues/389/events","html_url":"https://github.com/diesel-rs/diesel/issues/389","id":168610642,"number":389,"title":"custom_derive! + HasMany! not working for me","user":{"login":"bahlo","id":1725839,"avatar_url":"https://avatars.githubusercontent.com/u/1725839?v=3","gravatar_id":"","url":"https://api.github.com/users/bahlo","html_url":"https://github.com/bahlo","followers_url":"https://api.github.com/users/bahlo/followers","following_url":"https://api.github.com/users/bahlo/following{/other_user}","gists_url":"https://api.github.com/users/bahlo/gists{/gist_id}","starred_url":"https://api.github.com/users/bahlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bahlo/subscriptions","organizations_url":"https://api.github.com/users/bahlo/orgs","repos_url":"https://api.github.com/users/bahlo/repos","events_url":"https://api.github.com/users/bahlo/events{/privacy}","received_events_url":"https://api.github.com/users/bahlo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-01T10:04:00Z","updated_at":"2016-08-01T12:49:42Z","closed_at":"2016-08-01T12:49:42Z","body":"I have a setup similar to your getting started guide and want to add the [`HasMany!`](http://docs.diesel.rs/diesel/macro.HasMany!.html) macro with [`custom_derive`](https://crates.io/crates/custom_derive).\r\n\r\nCrate list in `main.rs`:\r\n```rust\r\n#![feature(custom_derive, custom_attribute, plugin)]\r\n#![plugin(diesel_codegen, dotenv_macros)]\r\n\r\n#[macro_use] extern crate diesel;\r\nextern crate dotenv;\r\n#[macro_use] extern crate custom_derive;\r\n```\r\n\r\nMy user model:\r\n```rust\r\ncustom_derive! {\r\n    #[derive(Identifiable, HasMany(items, foreign_key = user_id))]\r\n    #[table_name(users)]\r\n    pub struct User {\r\n        pub id: i32,\r\n        // Other fields\r\n    }\r\n}\r\n```\r\n\r\n`Cargo.toml` excerpt\r\n```toml\r\ndiesel = \"0.6.2\"\r\ndiesel_codegen = { version = \"0.6.2\", default-features = false, features = [\"nightly\", \"postgres\"] }\r\ndotenv = \"0.8.0\"\r\ndotenv_macros = \"0.8.0\"\r\ncustom_derive = \"0.1.5\"\r\n```\r\n\r\nWhen I run the code, I get the following output:\r\n```\r\n   Compiling my-app v0.1.0 (file:///Users/arne/Developer/my-app)\r\n<custom_derive macros>:114:32: 114:33 error: macro undefined: 'Identifiable!'\r\n<custom_derive macros>:114 $ ( $ user_drvs ) * $ new_user (  ) , ) } } ; (\r\n                                                          ^\r\n<custom_derive macros>:120:32: 120:33 error: macro undefined: 'HasMany!'\r\n<custom_derive macros>:120 $ ( $ user_drvs ) * $ new_user ( $ ( $ new_user_args ) * ) , ) } } ; (\r\n                                                          ^\r\nerror: aborting due to 2 previous errors\r\nerror: Could not compile `my-app`.\r\n\r\nTo learn more, run the command again with --verbose.\r\n```\r\n\r\nI'm thankful for any help 😊 "}}
{"actor":{"display_login":"bahlo"}}