<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/app/models/user_callout.rb, branch docs/add_file_diff_description</title>
<subtitle>gitlab.com: gitlab-org/gitlab-ce.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/'/>
<entry>
<title>Inherit from ApplicationRecord instead of ActiveRecord::Base</title>
<updated>2019-03-28T16:18:23+00:00</updated>
<author>
<name>Nick Thomas</name>
<email>nick@gitlab.com</email>
</author>
<published>2019-03-28T13:17:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=013f7cd24c4359d5d704b719d85b6df7ca1fdd55'/>
<id>013f7cd24c4359d5d704b719d85b6df7ca1fdd55</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor how a few ActiveRecord enums are defined</title>
<updated>2018-11-15T16:41:54+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2018-11-13T16:29:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=590ff80f839179c1e178e941cd57946e9bb91b79'/>
<id>590ff80f839179c1e178e941cd57946e9bb91b79</id>
<content type='text'>
In a few models we define ActiveRecord enums that are redefined in EE
using the following pattern:

    enum :some_enum, {
      ...
    }.merge(EE_ENUM_VALUES)

This particular approach is problematic to deal with, because it
requires that we `prepend` and EE module _before_ defining the enum.
This typically translates to the `prepend` being the first line in the
model in EE, but this can easily lead to merge conflicts when developers
add more `include` and/or `prepend` lines.

As part of https://gitlab.com/gitlab-org/gitlab-ee/issues/8244 and
https://gitlab.com/gitlab-org/gitlab-ee/issues/8241 we are moving
`prepend` to the last line in a file, reducing the chances of running
into merge conflicts. This poses a bit of a problem with the pattern
above, because this pattern does not allow us to move the `prepend`
further down a file.

To resolve this problem, we simply move the Hash value of the enum to a
separate class method. This method is defined in a separate module where
necessary, allowing us to use it like so:

    enum :failure_reasons, ::SomeModelEnums.failure_reasons

The method in turn is defined in a very straightforward manner:

    module SomeModelEnums
      def self.failure_reasons
        {
          ...
        }
      end
    end

This makes it easy for EE to add values without requiring the `prepend`
to be placed before the `enum` is defined.

For more information, see the following issues and merge requests:

* https://gitlab.com/gitlab-org/gitlab-ee/issues/8244
* https://gitlab.com/gitlab-org/gitlab-ee/issues/8241
* https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8424
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a few models we define ActiveRecord enums that are redefined in EE
using the following pattern:

    enum :some_enum, {
      ...
    }.merge(EE_ENUM_VALUES)

This particular approach is problematic to deal with, because it
requires that we `prepend` and EE module _before_ defining the enum.
This typically translates to the `prepend` being the first line in the
model in EE, but this can easily lead to merge conflicts when developers
add more `include` and/or `prepend` lines.

As part of https://gitlab.com/gitlab-org/gitlab-ee/issues/8244 and
https://gitlab.com/gitlab-org/gitlab-ee/issues/8241 we are moving
`prepend` to the last line in a file, reducing the chances of running
into merge conflicts. This poses a bit of a problem with the pattern
above, because this pattern does not allow us to move the `prepend`
further down a file.

To resolve this problem, we simply move the Hash value of the enum to a
separate class method. This method is defined in a separate module where
necessary, allowing us to use it like so:

    enum :failure_reasons, ::SomeModelEnums.failure_reasons

The method in turn is defined in a very straightforward manner:

    module SomeModelEnums
      def self.failure_reasons
        {
          ...
        }
      end
    end

This makes it easy for EE to add values without requiring the `prepend`
to be placed before the `enum` is defined.

For more information, see the following issues and merge requests:

* https://gitlab.com/gitlab-org/gitlab-ee/issues/8244
* https://gitlab.com/gitlab-org/gitlab-ee/issues/8241
* https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8424
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Merge branch 'ce-6983-promote-starting-a-gitlab-com-trial' into 'master'"</title>
<updated>2018-10-12T09:45:50+00:00</updated>
<author>
<name>Luke Bennett</name>
<email>lbennett@gitlab.com</email>
</author>
<published>2018-10-12T09:45:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=06c24d497de3b2e22b1a2fc13ae1cd2cb0100b84'/>
<id>06c24d497de3b2e22b1a2fc13ae1cd2cb0100b84</id>
<content type='text'>
This reverts merge request !21551</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts merge request !21551</pre>
</div>
</content>
</entry>
<entry>
<title>Lint</title>
<updated>2018-09-24T10:43:20+00:00</updated>
<author>
<name>Luke Bennett</name>
<email>lbennett@gitlab.com</email>
</author>
<published>2018-09-13T15:01:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=8c4399e530e8560321ab805bce426c99fb104d84'/>
<id>8c4399e530e8560321ab805bce426c99fb104d84</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>port EE</title>
<updated>2018-09-06T04:13:44+00:00</updated>
<author>
<name>Luke Bennett</name>
<email>lukeeeebennettplus@gmail.com</email>
</author>
<published>2018-09-06T04:13:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=693e435f2fb8be8f60f73ee69fcb8f5297522a82'/>
<id>693e435f2fb8be8f60f73ee69fcb8f5297522a82</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Enable frozen string in app/models/*.rb</title>
<updated>2018-07-26T23:55:41+00:00</updated>
<author>
<name>gfyoung</name>
<email>gfyoung17@gmail.com</email>
</author>
<published>2018-07-25T09:30:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=50abbd3e53d4f5e3e67543650a13aca9a54b37c2'/>
<id>50abbd3e53d4f5e3e67543650a13aca9a54b37c2</id>
<content type='text'>
Partially addresses #47424.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Partially addresses #47424.
</pre>
</div>
</content>
</entry>
<entry>
<title>Resolve "Inform users of up to $500 offer for GCP account"</title>
<updated>2018-05-07T18:06:02+00:00</updated>
<author>
<name>Dennis Tang</name>
<email>dennis@dennistang.net</email>
</author>
<published>2018-05-07T18:06:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=a9496c27c9bb2876b9d94bfbe33f252a931caa8f'/>
<id>a9496c27c9bb2876b9d94bfbe33f252a931caa8f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Bump UserCallout feature_name enum index</title>
<updated>2018-02-05T13:26:01+00:00</updated>
<author>
<name>Matija Čupić</name>
<email>matteeyah@gmail.com</email>
</author>
<published>2018-02-05T13:26:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=c1e1f8070b5f41731bea4dab936690382bfb486e'/>
<id>c1e1f8070b5f41731bea4dab936690382bfb486e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Change UserCallout feautre_name to enum</title>
<updated>2018-02-02T23:18:25+00:00</updated>
<author>
<name>Matija Čupić</name>
<email>matteeyah@gmail.com</email>
</author>
<published>2018-02-02T23:16:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=20714ee90232b5577fc99f2a773ddccf71482c08'/>
<id>20714ee90232b5577fc99f2a773ddccf71482c08</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename Callout to UserCallout</title>
<updated>2018-02-02T21:51:03+00:00</updated>
<author>
<name>Matija Čupić</name>
<email>matteeyah@gmail.com</email>
</author>
<published>2018-02-02T21:51:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=648826721f13ee4309a11638e538d96006648b39'/>
<id>648826721f13ee4309a11638e538d96006648b39</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
