Commit Graph

32 Commits

Author SHA1 Message Date
Chris Salzberg 759ea63a8e
Refactor inject 2018-05-11 13:30:42 +09:00
Sean Linsley f570a402bf improve memory usage 2017-12-31 20:30:53 -06:00
Steve Richert e55e99fe89 Use class attributes properly so that inheritance is respected
This fixes two bugs:

1. Subclasses were not properly inheriting their parents' Ransack
   aliases in Mongoid because each class defined its very own set of
   aliases.
2. In Active Record, Ransack aliases were defined in such a way that the
   parent's (and grandparent's, etc.) aliases were overwritten by the
   child, meaning that all aliases were ultimately kept on
   ActiveRecord::Base. This has the unfortunate effect of enforcing
   uniqueness of Ransack alias names across all models rather than per
   model. Depending on the load order of models, earlier definitions of
   an alias in other models would be clobbered.
2016-08-26 13:48:59 -04:00
Andrew Vit 7f1235adb5 Add new method stubs for mongoid 2016-02-16 12:30:28 -08:00
Andrew Vit 4b1544898c Clean out unused constant references 2016-02-16 01:07:55 -08:00
Jon Atack 6838220ece This was moved from Squeel to Polyamorous [skip ci] 2016-01-01 23:38:45 +01:00
Jon Atack 2a8eca4847 Wrap lines at 80 chars and keep conditionals explicit and ugly
to motivate us to refactor them out.
2015-12-20 01:01:41 +01:00
Ray Zane e712ff1ce4 Allow creating aliases for ransack attributes 2015-12-11 18:34:47 -05:00
Penn Su ab8bda9af8 Use dot notation for attr_name and valid?, type_for adjustments
If `skills_name_cont` is passed in where skills is a embeds_many relation and name is the attribute of the Skill, the attr_name will becomes `skills.name` which will be passed in to the resulting predication query.
2015-01-21 01:27:31 -08:00
Penn Su f55770f4d7 Include embedded relations 2015-01-21 01:24:08 -08:00
Jon Atack 67a605a0e2 Revert 846b168 2014-12-20 23:50:10 +01:00
Jon Atack 846b1687ec Avoid `hash` as a variable name
Not sure using `hash` poses any risk, but the Ruby docs use `h` or
`hsh`:

http://www.ruby-doc.org/core-2.1.5/Hash.html
2014-12-19 13:02:46 +01:00
Jon Atack 29428ae481 Remove unneeded namespacing 2014-11-21 20:03:20 +01:00
Jon Atack 634863cf88 Moar constants instead of string allocs for Ruby < 2.1 2014-11-21 18:45:05 +01:00
Ricardo Brazão 6eb263d32e removed binding.pry 2014-11-08 13:06:13 +00:00
Jon Atack 792c7d4737 Use string constants in Mongoid::Context 2014-11-04 21:01:55 +01:00
Zhomart Mukhamejanov 696dd5b183 following code conventions in adapters/mongoid 2014-11-03 16:54:17 -08:00
Zhomart Mukhamejanov 378c7d59dd Fixed mongoid search by id 2014-11-02 11:14:37 -08:00
Zhomart Mukhamejanov ee23c4a1bb predications fixed 2014-08-26 23:17:54 -07:00
Zhomart Mukhamejanov aff2151b10 added starts, ends 2014-08-02 20:37:22 -07:00
Zhomart Mukhamejanov 80c71f8b29 predications in, not_in added 2014-08-02 19:57:23 -07:00
Zhomart Mukhamejanov 116884ce60 added mongoid/attrs/order_predications 2014-08-02 18:38:44 -07:00
Zhomart Mukhamejanov 9facab1bc2 mongoid predications updated 2014-08-02 17:05:19 -07:00
Zhomart Mukhamejanov b6574263f6 added more predication methods. 2014-08-02 17:00:42 -07:00
Zhomart Mukhamejanov d2b02689cb added some features to ransack/mongoid 2014-08-02 14:25:52 -07:00
Zhomart Mukhamejanov 2ef4210f85 added active_record style method Mongoid::Document.first(n) 2014-08-02 11:08:29 -07:00
Zhomart Mukhamejanov 55d6b88de1 mongoid translate spec works 2014-08-02 10:38:40 -07:00
Zhomart Mukhamejanov dace90ec93 sorting for mongoid works 2014-08-02 10:36:23 -07:00
Zhomart Mukhamejanov b85abef5ed ransack method for Mongoid::Document improved 2014-08-02 10:35:51 -07:00
Zhomart Mukhamejanov 718a05b331 ransack made more abstract and added mongoid 2014-08-01 21:06:39 -07:00
Zhomart Mukhamejanov 7cb697a98c adapter/mongoid little bit adapted 2014-08-01 02:05:25 -07:00
Zhomart Mukhamejanov d16c8b0c1b mongoid initialized 2014-07-31 23:42:22 -07:00