100+ results for '_ pluck'
Not the results you expected?
Line.cpp (https://github.com/jtnimoy/Bandwidth.git) C++ · 195 lines
labels_controller.rb (https://gitlab.com/deckar01/gitlab-ce) Ruby · 164 lines
reportable.rb (https://gitlab.com/Rambabu.d/sujala) Ruby · 140 lines
stat_graph_contributors_graph_spec.js (https://gitlab.com/ayufan/gitlab-ce-repo-2) JavaScript · 133 lines
order-summary-item.tsx (https://gitlab.com/remyvianne/krowkaramel) TypeScript · 215 lines
named.rb (https://github.com/benolee/rails.git) Ruby · 158 lines
README.md (https://gitlab.com/blocknotary/IonicInterviews) Markdown · 118 lines
77 * [object.filter](https://www.npmjs.com/package/object.filter): Create a new object filtered to have only properties for which the callback returns true. | [homepage](https://github.com/jonschlinkert/object.filter "Create a new object filtered to have only properties for which the callback returns true.")
78 * [object.pick](https://www.npmjs.com/package/object.pick): Returns a filtered copy of an object with only the specified keys, similar to `_.pick… [more](https://github.com/jonschlinkert/object.pick) | [homepage](https://github.com/jonschlinkert/object.pick "Returns a filtered copy of an object with only the specified keys, similar to`_.pick` from lodash / underscore.")
79 * [object.pluck](https://www.npmjs.com/package/object.pluck): Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with… [more](https://github.com/jonschlinkert/object.pluck) | [homepage](https://github.com/jonschlinkert/object.pluck "Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with values unmodified from those of the original object.")
80 * [object.reduce](https://www.npmjs.com/package/object.reduce): Reduces an object to a value that is the accumulated result of running each property… [more](https://github.com/jonschlinkert/object.reduce) | [homepage](https://github.com/jonschlinkert/object.reduce "Reduces an object to a value that is the accumulated result of running each property in the object through a callback.")
virtual-dom-parser.ts (https://github.com/Foundry376/Mailspring.git) TypeScript · 168 lines
job_config_builder_spec.rb (https://github.com/simpsonjulian/jenkins.rb.git) Ruby · 150 lines
stat_graph_contributors_graph_spec.js (https://gitlab.com/jacobvosmaer-gitlab/gitlab-ce) JavaScript · 128 lines
project_team.rb (https://gitlab.com/mahcsig/gitlab-ce) Ruby · 207 lines
sinon_extensions.js (https://bitbucket.org/schatt/chorus.git) JavaScript · 248 lines
110 fetch.succeed(response, pagination);
111 } else {
112 throw "No fetch found for " + model.url() + ". Found fetches for: [" + _.pluck(this.fetches(), 'url').join(', ') + "]";
113 }
114 },
120 update.succeed(response, pagination);
121 } else {
122 throw "No update found for " + model.url() + ". Found updates for: [" + _.pluck(this.creates(), 'url').join(', ') + "]";
123 }
124 },
130 create.succeed(response);
131 } else {
132 throw "No create found for " + model.url() + ". Found creates for: [" + _.pluck(this.creates(), 'url').join(', ') + "]";
133 }
134 },
test_nestedset.py (https://github.com/frappe/frappe.git) Python · 235 lines
refresh_service_spec.rb (https://gitlab.com/gwawr/gitlab-ee) Ruby · 312 lines
278 refresh_service.execute(@oldrev, @newrev, 'refs/heads/feature')
280 issue_ids = MergeRequestsClosingIssues.where(merge_request: merge_request).pluck(:issue_id)
281 expect(issue_ids).to eq([issue.id])
282 end
297 refresh_service.execute(@oldrev, @newrev, 'refs/heads/feature')
299 issue_ids = MergeRequestsClosingIssues.where(merge_request: merge_request).pluck(:issue_id)
300 expect(issue_ids).to eq([issue.id])
301 end
DocumentModel.php (https://github.com/akaunting/akaunting.git) PHP · 196 lines
65 $percent = 0;
67 $discount = $this->totals->where('code', 'discount')->makeHidden('title')->pluck('amount')->first();
69 if ($discount) {
70 $sub_total = $this->totals->where('code', 'sub_total')->makeHidden('title')->pluck('amount')->first();
72 $percent = number_format((($discount * 100) / $sub_total), 0);
Model.php (https://github.com/Anankke/SSPanel-Uim.git) PHP · 54 lines
33 * @method Eloquent\Model[]|static getModels($columns = ['*']) Get the hydrated models without eager loading.
34 * @method \Illuminate\Support\LazyCollection cursor() Get a lazy collection for the given query.
35 * @method \Illuminate\Support\Collection pluck($column, $key = null) Get an array with the values of a given column.
36 * @method \Illuminate\Contracts\Pagination\LengthAwarePaginator paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) Paginate the given query.
37 * @method \Illuminate\Contracts\Pagination\Paginator simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) Paginate the given query into a simple paginator.
Rule.php (https://github.com/houdunwang/video.git) PHP · 155 lines
show_controller.js.coffee (https://github.com/xbmc/chorus2.git) CoffeeScript · 137 lines
25 key: 'set'
26 type: 'string'
27 pluck: false
28 }
29 {
32 key: 'genre'
33 type: 'array'
34 pluck: false
35 }
36 {
105 filterVal = false
106 if more.type is 'array'
107 filterVals = if more.pluck then _.pluck(movie.get(more.key), more.pluck) else movie.get(more.key)
108 filterVals = _.shuffle filterVals.slice(0, 4)
109 filterVal = _.first filterVals
sa-TotalMonthlyByReseller.js (https://gitlab.com/stoicsoftware/netsuite-sku-analytics) JavaScript · 342 lines
Accounts.php (https://github.com/akaunting/akaunting.git) PHP · 227 lines
42 public function create()
43 {
44 $currencies = Currency::enabled()->pluck('name', 'code');
46 $currency = Currency::where('code', '=', setting('default.currency'))->first();
86 public function edit(Account $account)
87 {
88 $currencies = Currency::enabled()->pluck('name', 'code');
90 $account->default_account = ($account->id == setting('default.account')) ? 1 : 0;
204 if (isset($account->currency_code)) {
205 $currencies = Currency::enabled()->pluck('name', 'code')->toArray();
207 if (array_key_exists($account->currency_code, $currencies)) {
todo_service.rb (https://gitlab.com/alexsanford/gitlab-ce) Ruby · 342 lines
Arr.php (https://gitlab.com/wilmertri/tutorial_mvc) PHP · 528 lines
354 /**
355 * Pluck an array of values from an array.
356 *
357 * @param array $array
360 * @return array
361 */
362 public static function pluck($array, $value, $key = null)
363 {
364 $results = [];
366 list($value, $key) = static::explodePluckParameters($value, $key);
368 foreach ($array as $item) {
issuable_finder.rb (https://gitlab.com/lee.claude/gitlab-ce.git) Ruby · 227 lines
h2_http_proxy.cc (https://github.com/saaras-io/yastack.git) C++ · 134 lines
personal_access_token_spec.rb (https://gitlab.com/18dit020/gitlab) Ruby · 326 lines
util.ts (https://github.com/WhisperSystems/Signal-Browser.git) TypeScript · 260 lines
project_authorizations_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 311 lines
notification_recipient_service.rb (https://gitlab.com/kivlor/gitlab-ce) Ruby · 302 lines
backend.memory.test.js (https://github.com/SEL-Columbia/formhub.git) JavaScript · 370 lines
31 var data = _wrapData();
32 equal(data.fields.length, 7);
33 deepEqual(['id', 'date', 'x', 'y', 'z', 'country', 'label'], _.pluck(data.fields, 'id'));
34 equal(memoryData.length, data.data.length);
35 });
82 data.query({q: 'UK'}).then(function(out) {
83 equal(out.total, 3);
84 deepEqual(_.pluck(out.hits, 'country'), ['UK', 'UK', 'UK']);
85 });
249 dataset.fetch().then(function(datasetAgain) {
250 equal(dataset.get('name'), memoryData.metadata.name);
251 deepEqual(_.pluck(dataset.fields.toJSON(), 'id'), _.pluck(data.fields, 'id'));
252 equal(dataset.recordCount, 6);
253 });
section_spec.rb (https://github.com/benjaminvialle/Markus.git) Ruby · 106 lines
86 before { section.update_starter_file_group(assignment.id, starter_file_groups.first.id) }
87 it 'should assign the new starter file group' do
88 ids = section.reload.section_starter_file_groups.pluck(:starter_file_group_id)
89 expect(ids).to include starter_file_groups.first.id
90 end
94 before { section.update_starter_file_group(assignment.id, starter_file_groups.first.id) }
95 it 'should assign the new starter file group' do
96 ids = section.reload.section_starter_file_groups.pluck(:starter_file_group_id)
97 expect(ids).to include starter_file_groups.first.id
98 end
99 it 'should remove the old starter file group' do
100 ids = section.reload.section_starter_file_groups.pluck(:starter_file_group_id)
101 expect(ids).not_to include starter_file_groups.second.id
102 end
arr-helpers.php (https://gitlab.com/knowthecode/ktc-must-use) PHP · 343 lines
template.php (https://github.com/dxw/buddypress.git) PHP · 378 lines
33 $users = is_array( $members_template->members ) ? array_values( $members_template->members ) : array();
34 $user_ids = wp_list_pluck( $users, 'ID' );
35 sort( $user_ids );
86 $requests = is_array( $members_template->members ) ? array_values( $members_template->members ) : array();
87 $request_ids = wp_list_pluck( $requests, 'ID' );
88 $this->assertEquals( $request_ids, array( $u1 ) );
119 $requests = is_array( $members_template->members ) ? array_values( $members_template->members ) : array();
120 $request_ids = wp_list_pluck( $requests, 'ID' );
121 $this->assertEquals( array(), $request_ids );
search_results.rb (https://gitlab.com/523/gitlab-ce) Ruby · 258 lines
206 # Filter milestones by authorized projects.
207 # For performance reasons project_id is being plucked
208 # to be used on a smaller query.
209 #
213 milestones.where(project_id: project_ids_relation)
214 .select(:project_id).distinct
215 .pluck(:project_id)
217 return Milestone.none if project_ids.nil?
person.js (https://github.com/Impactstory/impactstory-tng.git) JavaScript · 149 lines
64 // total posts
65 var postCounts = _.pluck(data.sources, "posts_count")
66 data.numPosts = postCounts.reduce(function(a, b){return a + b}, 0)
68 // date of earliest publication
69 var earliestPubYear = _.min(_.pluck(data.products, "year"))
70 if (earliestPubYear > 0 && earliestPubYear <= 2015) {
71 data.publishingAge = 2016 - earliestPubYear
graph.js (https://github.com/aslanides/aixijs.git) JavaScript · 222 lines
entry.js (https://github.com/devdazed/node.git) JavaScript · 212 lines
VersionManager.php (https://gitlab.com/fbi/october) PHP · 463 lines
backfill_project_repositories_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 106 lines
40 describe '.on_hashed_storage' do
41 it 'finds projects with repository on hashed storage' do
42 projects = described_class.on_hashed_storage.pluck(:id)
44 expect(projects).to match_array([project_hashed_storage_1.id, project_hashed_storage_2.id])
48 describe '.on_legacy_storage' do
49 it 'finds projects with repository on legacy storage' do
50 projects = described_class.on_legacy_storage.pluck(:id)
52 expect(projects).to match_array([project_legacy_storage_3.id, project_legacy_storage_4.id, project_legacy_storage_5.id])
59 create(:project_repository, project: project_legacy_storage_3)
61 projects = described_class.without_project_repository.pluck(:id)
63 expect(projects).to contain_exactly(project_hashed_storage_2.id, project_legacy_storage_4.id, project_legacy_storage_5.id)
dast_site_profile.rb (https://gitlab.com/zillemarco/gitlab) Ruby · 132 lines
ProjectsController.php (https://gitlab.com/mlnkv/ribbbon) PHP · 134 lines
102 //
103 // // Get the id of the user being sent the invite
104 // $user_id = DB::table('users')->whereEmail(Input::get('email'))->pluck('id');
105 //
106 // if( count(Projectuser::whereUserId($user_id)->whereProjectId($id)->get()) != 0 )
117 //
118 // // Prepare email invitation & send it
119 // $project_name = Project::find($id)->pluck('name');
120 // $project_url = url() . '/projects/'.$id;
121 // sendProjectInviteMail(Input::get('email'), $project_name, $project_url);
stat_graph_contributors_graph.js (https://gitlab.com/Razzeee/gitlab-ce) JavaScript · 278 lines
collection_proxy.rb (https://github.com/kuroda/rails.git) Ruby · 126 lines
records_fetcher_spec.rb (https://gitlab.com/realsatomic/gitlab) Ruby · 146 lines
dast_latest_gitlab_ci_yaml_spec.rb (https://gitlab.com/realsatomic/gitlab) Ruby · 172 lines
methods.ts (https://github.com/funkia/list.git) TypeScript · 414 lines
17 last(): A | undefined;
18 map<B>(f: (a: A) => B): List<B>;
19 pluck<K extends keyof A>(key: K): List<A[K]>;
20 foldl<B>(f: (acc: B, value: A) => B, initial: B): B;
21 reduce<B>(f: (acc: B, value: A) => B, initial: B): B;
133 };
135 List.prototype.pluck = function<A, K extends keyof A>(
136 this: List<A>,
137 key: K
138 ): List<A[K]> {
139 return L.pluck(key, this);
140 } as any;
volumes.go (https://github.com/dotcloud/docker.git) Go · 140 lines
expand.js (https://gitlab.com/jorgegoes/jointswp-child) JavaScript · 248 lines
collection.md (https://gitlab.com/DamZou/test) Markdown · 233 lines
114 ## pluck(list, propName):Array
116 Extract a list of property values.
128 ];
130 pluck(users, 'name'); // ["John", "Jane"]
131 pluck(users, 'age'); // [21, 27]
142 };
144 pluck(users, 'name'); // ['John', 'Mary']
145 ```
147 See: [array/pluck](array.html#pluck), [object/pluck](object.html#pluck)
dast_api_latest_gitlab_ci_yaml_spec.rb (https://gitlab.com/zillemarco/gitlab) Ruby · 130 lines
37 let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
38 let(:pipeline) { service.execute!(:push).payload }
39 let(:build_names) { pipeline.builds.pluck(:name) }
41 before do
102 context 'when CI_GITLAB_FIPS_MODE=false' do
103 let(:build_dast_api) { pipeline.builds.find_by(name: 'dast_api') }
104 let(:build_variables) { build_dast_api.variables.pluck(:key, :value) }
106 before do
115 context 'when CI_GITLAB_FIPS_MODE=true' do
116 let(:build_dast_api) { pipeline.builds.find_by(name: 'dast_api') }
117 let(:build_variables) { build_dast_api.variables.pluck(:key, :value) }
119 before do
adduser.js (https://bitbucket.org/chunyang/socket-io-demo.git) JavaScript · 137 lines
editRole.blade.php (https://github.com/lubusIN/laravel-gymie.git) PHP · 94 lines
cycle_analytics_events_spec.rb (https://gitlab.com/solidnerd/gitlab-ce) Ruby · 134 lines
24 get project_cycle_analytics_issue_path(project, format: :json)
26 first_issue_iid = project.issues.sort_by_attribute(:created_desc).pluck(:iid).first.to_s
28 expect(json_response['events']).not_to be_empty
44 expect(json_response['events']).not_to be_empty
46 first_mr_iid = project.merge_requests.sort_by_attribute(:created_desc).pluck(:iid).first.to_s
48 expect(json_response['events'].first['iid']).to eq(first_mr_iid)
59 get project_cycle_analytics_review_path(project, format: :json)
61 first_mr_iid = project.merge_requests.sort_by_attribute(:created_desc).pluck(:iid).first.to_s
63 expect(json_response['events']).not_to be_empty
backbone.babysitter.js (https://bitbucket.org/synapsos/lounge-old.git) JavaScript · 213 lines
itertoolz.pxd (https://github.com/ryfeus/lambda-packs.git) Cython · 278 lines
stock_transfer.js.coffee (https://github.com/chienyuan/spree.git) CoffeeScript · 179 lines
product-attributes.php (https://github.com/woothemes/woocommerce.git) PHP · 268 lines
143 // Ensure our custom attribute is not in the results (proof of core endpoint).
144 $names = wp_list_pluck( $attributes, 'name' );
145 $this->assertNotContains( 'Numeric Size', $names );
146 }
166 // Results should include "number" and "Numeric Size".
167 $names = wp_list_pluck( $attributes, 'name' );
168 $this->assertContains( 'number', $names );
169 $this->assertContains( 'Numeric Size', $names );
244 $this->assertEquals( 3, count( $terms ) );
246 $slugs = wp_list_pluck( $terms, 'slug' );
247 $this->assertContains( 'small', $slugs );
248 $this->assertContains( 'large', $slugs );
index.ts (https://gitlab.com/nguyenthehiep3232/marius) TypeScript · 105 lines
55 export { pairwise } from '../internal/operators/pairwise';
56 export { partition } from '../internal/operators/partition';
57 export { pluck } from '../internal/operators/pluck';
58 export { publish } from '../internal/operators/publish';
59 export { publishBehavior } from '../internal/operators/publishBehavior';
session.php (https://gitlab.com/haque.mdmanzurul/wp-harpar-carolyn) PHP · 430 lines
lfs_restorer_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 128 lines
pretty-error.coffee (https://gitlab.com/chriswhalen/flipkicks) CoffeeScript · 309 lines
122 unskipPackage: (packages...) ->
123 array.pluckOneItem(@_packagesToSkip, pkg) for pkg in packages
124 @
134 unskipPath: (paths...) ->
135 array.pluckOneItem(@_pathsToSkip, path) for path in paths
136 @
146 unskip: (callbacks...) ->
147 array.pluckOneItem(@_skipCallbacks, cb) for cb in callbacks
148 @
issuable_collections.rb (https://gitlab.com/jamedjo/gitlab-ce) Ruby · 114 lines
facts.rb (https://github.com/theforeman/foreman.git) Ruby · 105 lines
59 default: '',
60 full_name: N_('Default location'),
61 collection: proc { Hash[Location.all.pluck(:title).map { |title| [title, title] }] })
62 setting('default_organization',
63 type: :string,
65 default: '',
66 full_name: N_('Default organization'),
67 collection: proc { Hash[Organization.all.pluck(:title).map { |title| [title, title] }] })
68 setting('update_hostgroup_from_facts',
69 type: :boolean,
ArticleController.php (https://bitbucket.org/clickmysoft/ecocar_rental.git) PHP · 171 lines
contributions_calendar.rb (https://gitlab.com/markglenfletcher/gitlab-ee) Ruby · 97 lines
75 # use IN(project_ids...) instead. It's the intersection of two users so
76 # the list will be (relatively) short
77 @contributed_project_ids ||= projects.distinct.pluck(:id)
78 authed_projects = Project.where(id: @contributed_project_ids)
79 .with_feature_available_for_user(feature, current_user)
collection.js (https://gitlab.com/nVySin/Mo_Grabber) JavaScript · 42 lines
remote-db.service.ts (https://gitlab.com/hearoy/M1-projetNomade) TypeScript · 172 lines
querying.rb (https://github.com/mickeyreiss/rails.git) Ruby · 67 lines
11 :where, :preload, :eager_load, :includes, :from, :lock, :readonly,
12 :having, :create_with, :uniq, :references, :none, :to => :all
13 delegate :count, :average, :minimum, :maximum, :sum, :calculate, :pluck, :ids, :to => :all
15 # Executes a custom SQL query against your database and returns all the results. The results will
Artist.php (https://gitlab.com/Kille250/myimouto) PHP · 282 lines
criterion.rb (https://github.com/tobioboye/Markus.git) Ruby · 272 lines
nijie.rb (https://github.com/r888888888/danbooru.git) Ruby · 174 lines
left_outer_join_association_test.rb (https://github.com/cjolly/rails.git) Ruby · 91 lines
data_sources_controller_spec.rb (https://bitbucket.org/schatt/chorus.git) Ruby · 241 lines
41 it "filters by gpdb data sources" do
42 get :index, :entity_type => "gpdb_data_source", :all => true
43 decoded_response.map(&:id).should =~ GpdbDataSource.pluck(:id)
44 end
46 it "filters by oracle data sources" do
47 get :index, :entity_type => "oracle_data_source", :all => true
48 decoded_response.map(&:id).should =~ OracleDataSource.pluck(:id)
49 end
50 end
SpotlightSeeder.php (https://github.com/ppy/osu-web.git) PHP · 131 lines
index.d.ts (https://github.com/xuliangzhan/xe-utils.git) TypeScript Typings · 189 lines
taxonomy.php (https://github.com/livinglab/openlab.git) PHP · 314 lines
querying.rb (https://github.com/oscardelben/rails.git) Ruby · 69 lines
12 :where, :preload, :eager_load, :includes, :from, :lock, :readonly,
13 :having, :create_with, :uniq, :references, :none, :to => :scoped
14 delegate :count, :average, :minimum, :maximum, :sum, :calculate, :pluck, :to => :scoped
16 # Executes a custom SQL query against your database and returns all the results. The results will
wiredep.js (https://gitlab.com/laurenmbeatty/collaborate_2016) JavaScript · 146 lines
user_serializer.rb (https://gitlab.com/mba811/discourse.git) Ruby · 257 lines
list_service.rb (https://gitlab.com/jamedjo/gitlab-ce) Ruby · 73 lines
remove_duplicated_cs_findings_without_vulnerability_id_spec.rb (https://gitlab.com/axil/gitlab) Ruby · 106 lines
choices.js (https://gitlab.com/jorgegoes/jointswp-child) JavaScript · 173 lines
custom_project_templates_finder_spec.rb (https://gitlab.com/michold/git-lab-playground) Ruby · 108 lines
querying.rb (https://github.com/bradediger/rails.git) Ruby · 64 lines
list.js (https://gitlab.com/blocknotary/IonicInterviews) JavaScript · 184 lines
ExportHelper.class.php (https://github.com/marcoax/maguttiCms.git) PHP · 163 lines
FieldsController.php (https://github.com/marketplacekit/marketplacekit.git) PHP · 148 lines
build_gitlab_ci_yaml_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 58 lines
LogMessageFormatter.php (https://gitlab.com/remyvianne/krowkaramel) PHP · 173 lines
78 $endpoint
79 ) {
80 $method = $this->pluck('method', $requestData);
81 $argument = $this->pluck('argument', $requestData);
83 $status = $this->pluck('status', $responseData);
85 if ($status->code !== 0) {
115 $logMessageTokens = [];
117 $method = $this->pluck('method', $requestData);
118 $argument = $this->pluck('argument', $requestData);
119 $metadata = $this->pluck('metadata', $requestData) ?: [];
121 $response = $this->pluck('response', $responseData);
status_collection.rb (git://github.com/gitlabhq/gitlabhq.git) Ruby · 142 lines
set_helpers_test.js (https://github.com/fangel/RelAlg.js.git) JavaScript · 126 lines
107 })
108 })
109 describe("Pluck", function() {
110 it("Should pluck out the values in the given positions", function() {
111 assert.deepEqual([], SetHelper.Pluck([1,2,3], []))
112 assert.deepEqual([1], SetHelper.Pluck([1,2,3], [0]))
113 assert.deepEqual([2], SetHelper.Pluck([1,2,3], [1]))
114 assert.deepEqual([3], SetHelper.Pluck([1,2,3], [2]))
115 assert.deepEqual([1,2], SetHelper.Pluck([1,2,3], [0,1]))
116 assert.deepEqual([2,3], SetHelper.Pluck([1,2,3], [1,2]))
117 assert.deepEqual([1,2,3], SetHelper.Pluck([1,2,3], [0,1,2]))
118 })
119 it("Should ignore positions that are not in the set", function() {
issue_actions.rb (https://gitlab.com/hvlad/gitlab-ce) Ruby · 217 lines
aspects_dropdown_view_spec.js (https://github.com/bloodpet/diaspora.git) JavaScript · 126 lines
stk.h (https://github.com/pd-l2ork/pd.git) C Header · 92 lines
CountryLoader.php (https://github.com/rinvex/country.git) PHP · 248 lines
155 }
157 $result = static::pluck($target, $key);
159 return in_array('*', $key) ? static::collapse($result) : $result;
174 /**
175 * Pluck an array of values from an array.
176 *
177 * @param array $array
181 * @return array
182 */
183 protected static function pluck($array, $value, $key = null)
184 {
185 $results = [];
enumerable_test.rb (https://github.com/kuroda/rails.git) Ruby · 136 lines
rut4.htm (https://github.com/pcalcado/StMarkov.git) HTML · 178 lines
conversations_controller.rb (https://github.com/prellele/diaspora.git) Ruby · 121 lines
38 recipients_param, column = [%i(contact_ids id), %i(person_ids person_id)].find {|param, _| params[param].present? }
39 if recipients_param
40 person_ids = current_user.contacts.mutual.where(column => params[recipients_param].split(",")).pluck(:person_id)
41 end
101 current_user.contacts.find(params[:contact_id]).id
102 elsif params[:aspect_id]
103 current_user.aspects.find(params[:aspect_id]).contacts.pluck(:id).join(",")
104 end
114 def contacts_data
115 current_user.contacts.mutual.joins(person: :profile)
116 .pluck(*%w(contacts.id profiles.first_name profiles.last_name people.diaspora_handle))
117 .map {|contact_id, *name_attrs|
118 {value: contact_id, name: ERB::Util.h(Person.name_from_attrs(*name_attrs)) }
query_cache_spec.rb (https://gitlab.com/vsailakshmi/mongoid) Ruby · 446 lines
sa-TotalMonthly.js (https://gitlab.com/stoicsoftware/netsuite-sku-analytics) JavaScript · 252 lines
has_custom_fields.rb (https://gitlab.com/Ruwan-Ranganath/discourse) Ruby · 222 lines
60 klass.where(foreign_key => ids, :name => whitelisted_fields)
61 .pluck(foreign_key, :name, :value).each do |cf|
62 result[cf[0]] ||= {}
63 append_custom_field(result[cf[0]], cf[1], cf[2])
95 .where("#{fk} in (?)", map.keys)
96 .where("name in (?)", fields)
97 .pluck(fk, :name, :value).each do |id, name, value|
99 preloaded = map[id].preloaded_custom_fields
213 def refresh_custom_fields_from_db
214 target = Hash.new
215 _custom_fields.pluck(:name,:value).each do |key, value|
216 self.class.append_custom_field(target, key, value)
217 end
completion_queue.h (https://gitlab.com/AshleyMcVeigh/cloudComputingAssignment) C Header · 100 lines
validators.rb (https://gitlab.com/jamgregory/gitlab-ce) Ruby · 316 lines
wp-backbone.js (https://gitlab.com/thisishayat/itv-2016) JavaScript · 386 lines
195 // view. Used in conjunction with `Views.render()`.
196 detach: function() {
197 $( _.pluck( this.all(), 'el' ) ).detach();
198 return this;
199 },
293 return this;
295 managers = _.chain( views ).pluck('views').flatten().value();
297 // Render the views if necessary.
306 // Insert or replace the views.
307 this[ options.add ? 'insert' : 'replace' ]( $selector, _.pluck( views, 'el' ), options );
309 // Set attached and trigger ready if the current view is already
favorites.html (https://repo.or.cz/cds-indico.git) HTML · 111 lines
Revenues.php (https://github.com/akaunting/akaunting.git) PHP · 232 lines
33 $revenues = Transaction::with('account', 'category', 'contact', 'invoice')->income()->isNotTransfer()->collect(['paid_at'=> 'desc']);
35 $customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
37 $categories = Category::income()->enabled()->orderBy('name')->pluck('name', 'id');
39 $accounts = Account::enabled()->orderBy('name')->pluck('name', 'id');
41 return view('sales.revenues.index', compact('revenues', 'customers', 'categories', 'accounts'));
59 public function create()
60 {
61 $accounts = Account::enabled()->orderBy('name')->pluck('name', 'id');
63 $currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
getPageOfComment.php (https://github.com/WordPress/wordpress-develop.git) PHP · 549 lines
486 remove_filter( 'wp_get_current_commenter', array( $this, 'get_current_commenter' ) );
488 $this->assertContains( $new_unapproved, wp_list_pluck( $comments, 'comment_ID' ) );
489 }
535 );
537 $this->assertContains( $new_unapproved, wp_list_pluck( $comments, 'comment_ID' ) );
539 wp_set_current_user( $current_user );