{"action":"created","issue":{"url":"https://api.github.com/repos/stephskardal/rails_admin_import/issues/44","labels_url":"https://api.github.com/repos/stephskardal/rails_admin_import/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/stephskardal/rails_admin_import/issues/44/comments","events_url":"https://api.github.com/repos/stephskardal/rails_admin_import/issues/44/events","html_url":"https://github.com/stephskardal/rails_admin_import/issues/44","id":117947903,"number":44,"title":"Custom object_label_method for RailsAdmin config causes imports to error","user":{"login":"codealchemy","id":4504083,"avatar_url":"https://avatars.githubusercontent.com/u/4504083?v=3","gravatar_id":"","url":"https://api.github.com/users/codealchemy","html_url":"https://github.com/codealchemy","followers_url":"https://api.github.com/users/codealchemy/followers","following_url":"https://api.github.com/users/codealchemy/following{/other_user}","gists_url":"https://api.github.com/users/codealchemy/gists{/gist_id}","starred_url":"https://api.github.com/users/codealchemy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codealchemy/subscriptions","organizations_url":"https://api.github.com/users/codealchemy/orgs","repos_url":"https://api.github.com/users/codealchemy/repos","events_url":"https://api.github.com/users/codealchemy/events{/privacy}","received_events_url":"https://api.github.com/users/codealchemy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"monkbroc","id":1919681,"avatar_url":"https://avatars.githubusercontent.com/u/1919681?v=3","gravatar_id":"","url":"https://api.github.com/users/monkbroc","html_url":"https://github.com/monkbroc","followers_url":"https://api.github.com/users/monkbroc/followers","following_url":"https://api.github.com/users/monkbroc/following{/other_user}","gists_url":"https://api.github.com/users/monkbroc/gists{/gist_id}","starred_url":"https://api.github.com/users/monkbroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkbroc/subscriptions","organizations_url":"https://api.github.com/users/monkbroc/orgs","repos_url":"https://api.github.com/users/monkbroc/repos","events_url":"https://api.github.com/users/monkbroc/events{/privacy}","received_events_url":"https://api.github.com/users/monkbroc/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-11-20T01:40:13Z","updated_at":"2015-11-20T21:26:45Z","closed_at":"2015-11-20T21:15:09Z","body":"Import for model that has a custom object_label_method defined in the `RailsAdmin.config` fails on `private method 'custom_label_method' called for #<Model>` (ActiveRecord models)\r\n\r\nDug into it a bit more, looks to be coming from the `report_success` and `report_error` methods on `RailsAdminImport::Importer`, which in turn calls the [`label_for_model(object)`](https://github.com/stephskardal/rails_admin_import/blob/master/lib/rails_admin_import/import_model.rb#L19) which does a public send of the `abstract_model.config.object_label_method`, while that method is private if/when defined in the config. A custom object_label_method can include associated models as well (as mine did), so changing to `send` didn't resolve the issue.\r\n\r\nI've patched this by simply passing the `rails_admin_default_object_label_method` instead:\r\n\r\n```ruby\r\nmodule RailsAdminImport\r\n  class ImportModel\r\n    def label_for_model(object)\r\n      object.public_send(:rails_admin_default_object_label_method)\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nThis works for my purposes, not sure the approach you'd like to take - though I'd be happy to PR this if it'd be helpful.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/stephskardal/rails_admin_import/issues/comments/158528891","html_url":"https://github.com/stephskardal/rails_admin_import/issues/44#issuecomment-158528891","issue_url":"https://api.github.com/repos/stephskardal/rails_admin_import/issues/44","id":158528891,"user":{"login":"codealchemy","id":4504083,"avatar_url":"https://avatars.githubusercontent.com/u/4504083?v=3","gravatar_id":"","url":"https://api.github.com/users/codealchemy","html_url":"https://github.com/codealchemy","followers_url":"https://api.github.com/users/codealchemy/followers","following_url":"https://api.github.com/users/codealchemy/following{/other_user}","gists_url":"https://api.github.com/users/codealchemy/gists{/gist_id}","starred_url":"https://api.github.com/users/codealchemy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codealchemy/subscriptions","organizations_url":"https://api.github.com/users/codealchemy/orgs","repos_url":"https://api.github.com/users/codealchemy/repos","events_url":"https://api.github.com/users/codealchemy/events{/privacy}","received_events_url":"https://api.github.com/users/codealchemy/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T21:26:45Z","updated_at":"2015-11-20T21:26:45Z","body":":+1: Likewise, thanks again for looking into this so quickly."}}