{"action":"created","issue":{"url":"https://api.github.com/repos/devnacho/mountain_view/issues/40","repository_url":"https://api.github.com/repos/devnacho/mountain_view","labels_url":"https://api.github.com/repos/devnacho/mountain_view/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/devnacho/mountain_view/issues/40/comments","events_url":"https://api.github.com/repos/devnacho/mountain_view/issues/40/events","html_url":"https://github.com/devnacho/mountain_view/pull/40","id":151414551,"number":40,"title":"Add support for mocking a form builder objects","user":{"login":"drakmail","id":869453,"avatar_url":"https://avatars.githubusercontent.com/u/869453?v=3","gravatar_id":"","url":"https://api.github.com/users/drakmail","html_url":"https://github.com/drakmail","followers_url":"https://api.github.com/users/drakmail/followers","following_url":"https://api.github.com/users/drakmail/following{/other_user}","gists_url":"https://api.github.com/users/drakmail/gists{/gist_id}","starred_url":"https://api.github.com/users/drakmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drakmail/subscriptions","organizations_url":"https://api.github.com/users/drakmail/orgs","repos_url":"https://api.github.com/users/drakmail/repos","events_url":"https://api.github.com/users/drakmail/events{/privacy}","received_events_url":"https://api.github.com/users/drakmail/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-27T15:24:55Z","updated_at":"2016-04-28T17:29:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/devnacho/mountain_view/pulls/40","html_url":"https://github.com/devnacho/mountain_view/pull/40","diff_url":"https://github.com/devnacho/mountain_view/pull/40.diff","patch_url":"https://github.com/devnacho/mountain_view/pull/40.patch"},"body":"As a @tombeynon commented in a #26 it's not possible to generate Styleguides for components that need a form builder instance. In this PR I try to implement a possible solution for that issue. Now it's possible to pass in stubs config an ActiveRecord based class which will be used for mocking a form_builder need for component.\r\n\r\nFor example: if a component need a `form` parameter (which is must be an instance of Form Builder for, for example, `Something` model), now it's possible to mock it in stubs file like this:\r\n\r\n```yml\r\n:meta: 'information about the component button'\r\n:stubs:\r\n  -\r\n    :text: \"Hello\"\r\n    :form:\r\n      !ruby/object:Something\r\n        attributes:\r\n          item: \"test\" # also you could pass a model attributes\r\n```"},"comment":{"url":"https://api.github.com/repos/devnacho/mountain_view/issues/comments/215502882","html_url":"https://github.com/devnacho/mountain_view/pull/40#issuecomment-215502882","issue_url":"https://api.github.com/repos/devnacho/mountain_view/issues/40","id":215502882,"user":{"login":"kitop","id":143179,"avatar_url":"https://avatars.githubusercontent.com/u/143179?v=3","gravatar_id":"","url":"https://api.github.com/users/kitop","html_url":"https://github.com/kitop","followers_url":"https://api.github.com/users/kitop/followers","following_url":"https://api.github.com/users/kitop/following{/other_user}","gists_url":"https://api.github.com/users/kitop/gists{/gist_id}","starred_url":"https://api.github.com/users/kitop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kitop/subscriptions","organizations_url":"https://api.github.com/users/kitop/orgs","repos_url":"https://api.github.com/users/kitop/repos","events_url":"https://api.github.com/users/kitop/events{/privacy}","received_events_url":"https://api.github.com/users/kitop/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T17:29:21Z","updated_at":"2016-04-28T17:29:21Z","body":"Hi @drakmail, thanks for your contribution!\r\n\r\nI'm just curious if checking for `ActiveRecord::Base` when creating a form may hurt other issues. Maybe sometimes you want to pass an ActiveRecord object but not to use a form, only to display it's values.\r\nWould love to hear you thoughts on that."}}