lims-core 3.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +5 -0
- data/.rspec +1 -0
- data/.rvmrc +2 -0
- data/.travis.yml +2 -0
- data/.vimrc +27 -0
- data/.yard_templates/default/layout/html/footer.erb +0 -0
- data/.yardopts +1 -0
- data/Gemfile +54 -0
- data/Gemfile.lock +197 -0
- data/Guardfile +21 -0
- data/Guardfile.tmux +28 -0
- data/README.markdown +67 -0
- data/Rakefile +16 -0
- data/config/database.yml +16 -0
- data/doc/Array.html +116 -0
- data/doc/Array/ArrayLoggerPersistor.html +152 -0
- data/doc/Lims.html +114 -0
- data/doc/Lims/Core.html +178 -0
- data/doc/Lims/Core/Action.html +91 -0
- data/doc/Lims/Core/Actions.html +116 -0
- data/doc/Lims/Core/Actions/Action.html +216 -0
- data/doc/Lims/Core/Actions/Action/AfterEval.html +853 -0
- data/doc/Lims/Core/Actions/Action/InvalidParameters.html +268 -0
- data/doc/Lims/Core/Actions/ActionGroup.html +196 -0
- data/doc/Lims/Core/Actions/ActionGroup/AfterEval.html +315 -0
- data/doc/Lims/Core/Actions/BulkAction.html +224 -0
- data/doc/Lims/Core/Actions/BulkAction/AfterEval.html +253 -0
- data/doc/Lims/Core/Actions/TestActionGroup.html +101 -0
- data/doc/Lims/Core/Actions/TestActionGroup/Action.html +133 -0
- data/doc/Lims/Core/Actions/TestActionGroup/ActionGroup.html +127 -0
- data/doc/Lims/Core/Base.html +287 -0
- data/doc/Lims/Core/Base/AccessibleViaSuper.html +252 -0
- data/doc/Lims/Core/Base/ClassMethod.html +177 -0
- data/doc/Lims/Core/Base/HashString.html +177 -0
- data/doc/Lims/Core/Base/IsArrayOf.html +606 -0
- data/doc/Lims/Core/Base/State.html +130 -0
- data/doc/Lims/Core/Organization.html +113 -0
- data/doc/Lims/Core/Organization/Batch.html +106 -0
- data/doc/Lims/Core/Persistence.html +267 -0
- data/doc/Lims/Core/Persistence/ComparisonFilter.html +318 -0
- data/doc/Lims/Core/Persistence/Filter.html +252 -0
- data/doc/Lims/Core/Persistence/IdentityMap.html +409 -0
- data/doc/Lims/Core/Persistence/IdentityMap/Class.html +144 -0
- data/doc/Lims/Core/Persistence/IdentityMap/DuplicateError.html +126 -0
- data/doc/Lims/Core/Persistence/IdentityMap/DuplicateIdError.html +136 -0
- data/doc/Lims/Core/Persistence/IdentityMap/DuplicateObjectError.html +136 -0
- data/doc/Lims/Core/Persistence/IdentityMapClass.html +133 -0
- data/doc/Lims/Core/Persistence/Logger.html +105 -0
- data/doc/Lims/Core/Persistence/Logger/Persistor.html +334 -0
- data/doc/Lims/Core/Persistence/Logger/Session.html +452 -0
- data/doc/Lims/Core/Persistence/Logger/Store.html +470 -0
- data/doc/Lims/Core/Persistence/MessageBus.html +871 -0
- data/doc/Lims/Core/Persistence/MessageBus/ConnectionError.html +123 -0
- data/doc/Lims/Core/Persistence/MessageBus/InvalidSettingsError.html +122 -0
- data/doc/Lims/Core/Persistence/MultiCriteriaFilter.html +293 -0
- data/doc/Lims/Core/Persistence/PersistAssociationTrait.html +91 -0
- data/doc/Lims/Core/Persistence/PersistableTrait.html +91 -0
- data/doc/Lims/Core/Persistence/Persistor.html +3072 -0
- data/doc/Lims/Core/Persistence/Persistor/DuplicateError.html +205 -0
- data/doc/Lims/Core/Persistence/Persistor/DuplicateIdError.html +147 -0
- data/doc/Lims/Core/Persistence/Persistor/DuplicateObjectError.html +147 -0
- data/doc/Lims/Core/Persistence/PersistorTrait.html +91 -0
- data/doc/Lims/Core/Persistence/ResourceState.html +1738 -0
- data/doc/Lims/Core/Persistence/Search.html +269 -0
- data/doc/Lims/Core/Persistence/Search/CreateSearch.html +251 -0
- data/doc/Lims/Core/Persistence/Search/SearchPersistor.html +240 -0
- data/doc/Lims/Core/Persistence/Search/SearchSequelPersistor.html +396 -0
- data/doc/Lims/Core/Persistence/Sequel.html +117 -0
- data/doc/Lims/Core/Persistence/Sequel/Filters.html +462 -0
- data/doc/Lims/Core/Persistence/Sequel/ForTest.html +101 -0
- data/doc/Lims/Core/Persistence/Sequel/ForTest/Name.html +137 -0
- data/doc/Lims/Core/Persistence/Sequel/ForTest/Name/NamePersitor.html +143 -0
- data/doc/Lims/Core/Persistence/Sequel/Migrations.html +266 -0
- data/doc/Lims/Core/Persistence/Sequel/Persistor.html +665 -0
- data/doc/Lims/Core/Persistence/Sequel/Session.html +501 -0
- data/doc/Lims/Core/Persistence/Sequel/Store.html +417 -0
- data/doc/Lims/Core/Persistence/Session.html +2751 -0
- data/doc/Lims/Core/Persistence/Session/UnmanagedObjectError.html +111 -0
- data/doc/Lims/Core/Persistence/StateGroup.html +696 -0
- data/doc/Lims/Core/Persistence/StateList.html +498 -0
- data/doc/Lims/Core/Persistence/Store.html +695 -0
- data/doc/Lims/Core/Persistence/UuidResource.html +1044 -0
- data/doc/Lims/Core/Persistence/UuidResource/InvalidUuidError.html +111 -0
- data/doc/Lims/Core/Persistence/UuidResource/UuidResourcePersistor.html +337 -0
- data/doc/Lims/Core/Persistence/Uuidable.html +799 -0
- data/doc/Lims/Core/Persistor.html +320 -0
- data/doc/Lims/Core/Resource.html +165 -0
- data/doc/Object.html +228 -0
- data/doc/SessionSpec.html +101 -0
- data/doc/SessionSpec/Model.html +279 -0
- data/doc/SessionSpec/Model/ModelPersistor.html +327 -0
- data/doc/_index.html +732 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +127 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +127 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +167 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +1894 -0
- data/doc/top-level-namespace.html +100 -0
- data/lib/common.rb +18 -0
- data/lib/lims-core.rb +29 -0
- data/lib/lims-core/actions.rb +10 -0
- data/lib/lims-core/actions/action.rb +185 -0
- data/lib/lims-core/actions/action_group.rb +54 -0
- data/lib/lims-core/actions/bulk_action.rb +65 -0
- data/lib/lims-core/base.rb +132 -0
- data/lib/lims-core/helpers.rb +41 -0
- data/lib/lims-core/persistence.rb +15 -0
- data/lib/lims-core/persistence/comparison_filter.rb +54 -0
- data/lib/lims-core/persistence/filter.rb +23 -0
- data/lib/lims-core/persistence/identity_map.rb +55 -0
- data/lib/lims-core/persistence/logger/all.rb +5 -0
- data/lib/lims-core/persistence/logger/persistor.rb +35 -0
- data/lib/lims-core/persistence/logger/session.rb +30 -0
- data/lib/lims-core/persistence/logger/store.rb +37 -0
- data/lib/lims-core/persistence/message_bus.rb +131 -0
- data/lib/lims-core/persistence/multi_criteria_filter.rb +50 -0
- data/lib/lims-core/persistence/persist_association_trait.rb +96 -0
- data/lib/lims-core/persistence/persistable_trait.rb +150 -0
- data/lib/lims-core/persistence/persistor.rb +495 -0
- data/lib/lims-core/persistence/resource_state.rb +157 -0
- data/lib/lims-core/persistence/search.rb +3 -0
- data/lib/lims-core/persistence/search/all.rb +3 -0
- data/lib/lims-core/persistence/search/create_search.rb +55 -0
- data/lib/lims-core/persistence/search/search_persistor.rb +45 -0
- data/lib/lims-core/persistence/search/search_sequel_persistor.rb +40 -0
- data/lib/lims-core/persistence/sequel.rb +14 -0
- data/lib/lims-core/persistence/sequel/filters.rb +106 -0
- data/lib/lims-core/persistence/sequel/migrations.rb +14 -0
- data/lib/lims-core/persistence/sequel/migrations/add_audit_tables.rb +147 -0
- data/lib/lims-core/persistence/sequel/migrations/initial.rb +156 -0
- data/lib/lims-core/persistence/sequel/persistor.rb +200 -0
- data/lib/lims-core/persistence/sequel/session.rb +136 -0
- data/lib/lims-core/persistence/sequel/store.rb +37 -0
- data/lib/lims-core/persistence/session.rb +409 -0
- data/lib/lims-core/persistence/state_group.rb +97 -0
- data/lib/lims-core/persistence/state_list.rb +56 -0
- data/lib/lims-core/persistence/store.rb +73 -0
- data/lib/lims-core/persistence/uuid_resource.rb +115 -0
- data/lib/lims-core/persistence/uuid_resource_persistor.rb +43 -0
- data/lib/lims-core/persistence/uuidable.rb +107 -0
- data/lib/lims-core/resource.rb +21 -0
- data/lib/lims-core/subclass_tracker.rb +30 -0
- data/lib/lims-core/version.rb +5 -0
- data/lims-core.gemspec +40 -0
- data/makefile +52 -0
- data/showoff/core-2012-06-11/core/01_slide.md +237 -0
- data/showoff/core-2012-06-11/core/02_slide.md +110 -0
- data/showoff/core-2012-06-11/custom.css +44 -0
- data/showoff/core-2012-06-11/main/01_slide.md +53 -0
- data/showoff/core-2012-06-11/showoff.json +10 -0
- data/showoff/core-2012-06-11/tp1.tpl +1 -0
- data/spec/actions/action_group_spec.rb +39 -0
- data/spec/actions/spec_helper.rb +1 -0
- data/spec/persistence/identity_map_spec.rb +55 -0
- data/spec/persistence/logger/spec_helper.rb +7 -0
- data/spec/persistence/logger/store_spec.rb +48 -0
- data/spec/persistence/message_bus_spec.rb +76 -0
- data/spec/persistence/sequel/session_spec.rb +125 -0
- data/spec/persistence/sequel/spec_helper.rb +39 -0
- data/spec/persistence/sequel/store_shared.rb +25 -0
- data/spec/persistence/sequel/store_spec.rb +22 -0
- data/spec/persistence/session_spec.rb +199 -0
- data/spec/persistence/spec_helper.rb +2 -0
- data/spec/persistence/uuid_resource_spec.rb +80 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/subclass_tracker_sperc.rb +62 -0
- data/utils/constant_tree.rb +29 -0
- data/utils/stack.rb +48 -0
- metadata +402 -0
@@ -0,0 +1,117 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Lims::Core::Persistence::Sequel
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '../../..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../../../_index.html">Index (S)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../../Lims.html" title="Lims (module)">Lims</a></span></span> » <span class='title'><span class='object_link'><a href="../../Core.html" title="Lims::Core (module)">Core</a></span></span> » <span class='title'><span class='object_link'><a href="../Persistence.html" title="Lims::Core::Persistence (module)">Persistence</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Sequel</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Lims::Core::Persistence::Sequel
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<dt class="r1 last">Defined in:</dt>
|
75
|
+
<dd class="r1 last">lib/lims-core/persistence/sequel.rb<span class="defines">,<br />
|
76
|
+
spec/persistence/sequel/session_spec.rb,<br /> lib/lims-core/persistence/sequel/store.rb,<br /> lib/lims-core/persistence/sequel/session.rb,<br /> lib/lims-core/persistence/sequel/persistor.rb,<br /> lib/lims-core/persistence/sequel/migrations.rb</span>
|
77
|
+
</dd>
|
78
|
+
|
79
|
+
</dl>
|
80
|
+
<div class="clear"></div>
|
81
|
+
|
82
|
+
<h2>Overview</h2><div class="docstring">
|
83
|
+
<div class="discussion">
|
84
|
+
|
85
|
+
<p>Persistence module using the <a href="http://sequel.rubyforge.org/" target="_parent" title="sequel">sequel</a> gem. It
|
86
|
+
implements abstract/base classes : <span class='object_link'><a href="Sequel/Store.html" title="Lims::Core::Persistence::Sequel::Store (class)">Store</a></span>, <span class='object_link'><a href="Sequel/Session.html" title="Lims::Core::Persistence::Sequel::Session (class)">Session</a></span> etc.</p>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
<div class="tags">
|
92
|
+
|
93
|
+
|
94
|
+
</div><h2>Defined Under Namespace</h2>
|
95
|
+
<p class="children">
|
96
|
+
|
97
|
+
|
98
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Sequel/Filters.html" title="Lims::Core::Persistence::Sequel::Filters (module)">Filters</a></span>, <span class='object_link'><a href="Sequel/ForTest.html" title="Lims::Core::Persistence::Sequel::ForTest (module)">ForTest</a></span>, <span class='object_link'><a href="Sequel/Migrations.html" title="Lims::Core::Persistence::Sequel::Migrations (module)">Migrations</a></span>, <span class='object_link'><a href="Sequel/Persistor.html" title="Lims::Core::Persistence::Sequel::Persistor (module)">Persistor</a></span>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Sequel/Session.html" title="Lims::Core::Persistence::Sequel::Session (class)">Session</a></span>, <span class='object_link'><a href="Sequel/Store.html" title="Lims::Core::Persistence::Sequel::Store (class)">Store</a></span>
|
103
|
+
|
104
|
+
|
105
|
+
</p>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,462 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Lims::Core::Persistence::Sequel::Filters
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '../../../..';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../../../js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../../../js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="../../../../_index.html">Index (F)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../../../../Lims.html" title="Lims (module)">Lims</a></span></span> » <span class='title'><span class='object_link'><a href="../../../Core.html" title="Lims::Core (module)">Core</a></span></span> » <span class='title'><span class='object_link'><a href="../../Persistence.html" title="Lims::Core::Persistence (module)">Persistence</a></span></span> » <span class='title'><span class='object_link'><a href="../Sequel.html" title="Lims::Core::Persistence::Sequel (module)">Sequel</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Filters</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Module: Lims::Core::Persistence::Sequel::Filters
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<dt class="r1">Included in:</dt>
|
74
|
+
<dd class="r1"><span class='object_link'><a href="Persistor.html" title="Lims::Core::Persistence::Sequel::Persistor (module)">Persistor</a></span></dd>
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<dt class="r2 last">Defined in:</dt>
|
79
|
+
<dd class="r2 last">lib/lims-core/persistence/sequel/filters.rb</dd>
|
80
|
+
|
81
|
+
</dl>
|
82
|
+
<div class="clear"></div>
|
83
|
+
|
84
|
+
<h2>Overview</h2><div class="docstring">
|
85
|
+
<div class="discussion">
|
86
|
+
|
87
|
+
<p>Implementes filter methods needed by persitors.</p>
|
88
|
+
|
89
|
+
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
<div class="tags">
|
93
|
+
|
94
|
+
|
95
|
+
</div>
|
96
|
+
<h2>Constant Summary</h2>
|
97
|
+
|
98
|
+
<dl class="constants">
|
99
|
+
|
100
|
+
<dt id="COMPARISON_OPERATORS-constant" class="">COMPARISON_OPERATORS =
|
101
|
+
|
102
|
+
</dt>
|
103
|
+
<dd><pre class="code"><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>></span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span></pre></dd>
|
104
|
+
|
105
|
+
</dl>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<h2>
|
114
|
+
Instance Method Summary
|
115
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
116
|
+
</h2>
|
117
|
+
|
118
|
+
<ul class="summary">
|
119
|
+
|
120
|
+
<li class="public ">
|
121
|
+
<span class="summary_signature">
|
122
|
+
|
123
|
+
<a href="#add_comparison_filter-instance_method" title="#add_comparison_filter (instance method)">- (Persistor) <strong>add_comparison_filter</strong>(dataset, comparison_criteria) </a>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
</span>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'>
|
137
|
+
<p>Joins the comparison filter to the existing persistor.</p>
|
138
|
+
</div></span>
|
139
|
+
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li class="public ">
|
144
|
+
<span class="summary_signature">
|
145
|
+
|
146
|
+
<a href="#comparison_filter-instance_method" title="#comparison_filter (instance method)">- (Persistor) <strong>comparison_filter</strong>(criteria) </a>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
</span>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<span class="summary_desc"><div class='inline'>
|
160
|
+
<p>Implement a comparison filter for a Sequel::Persistor.</p>
|
161
|
+
</div></span>
|
162
|
+
|
163
|
+
</li>
|
164
|
+
|
165
|
+
|
166
|
+
<li class="public ">
|
167
|
+
<span class="summary_signature">
|
168
|
+
|
169
|
+
<a href="#multi_criteria_filter-instance_method" title="#multi_criteria_filter (instance method)">- (Persistor) <strong>multi_criteria_filter</strong>(criteria) </a>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</span>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
<span class="summary_desc"><div class='inline'>
|
183
|
+
<p>Implement a multicriteria filter for a Sequel::Persistor.</p>
|
184
|
+
</div></span>
|
185
|
+
|
186
|
+
</li>
|
187
|
+
|
188
|
+
|
189
|
+
</ul>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
<div id="instance_method_details" class="method_details_list">
|
195
|
+
<h2>Instance Method Details</h2>
|
196
|
+
|
197
|
+
|
198
|
+
<div class="method_details first">
|
199
|
+
<p class="signature first" id="add_comparison_filter-instance_method">
|
200
|
+
|
201
|
+
- (<tt><span class='object_link'><a href="Persistor.html" title="Lims::Core::Persistence::Sequel::Persistor (module)">Persistor</a></span></tt>) <strong>add_comparison_filter</strong>(dataset, comparison_criteria)
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
</p><div class="docstring">
|
206
|
+
<div class="discussion">
|
207
|
+
|
208
|
+
<p>Joins the comparison filter to the existing persistor.</p>
|
209
|
+
|
210
|
+
|
211
|
+
</div>
|
212
|
+
</div>
|
213
|
+
<div class="tags">
|
214
|
+
<h3>Parameters:</h3>
|
215
|
+
<ul class="param">
|
216
|
+
|
217
|
+
<li>
|
218
|
+
|
219
|
+
<span class='name'>dataset</span>
|
220
|
+
|
221
|
+
|
222
|
+
<span class='type'>(<tt>Dataset</tt>)</span>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
</li>
|
227
|
+
|
228
|
+
<li>
|
229
|
+
|
230
|
+
<span class='name'>criteria</span>
|
231
|
+
|
232
|
+
|
233
|
+
<span class='type'>(<tt>Hash<String, <span class='object_link'><a href="../../../../Object.html" title="Object (class)">Object</a></span>></tt>)</span>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
—
|
238
|
+
<div class='inline'>
|
239
|
+
<p>for the comparison</p>
|
240
|
+
</div>
|
241
|
+
|
242
|
+
</li>
|
243
|
+
|
244
|
+
</ul>
|
245
|
+
|
246
|
+
<h3>Returns:</h3>
|
247
|
+
<ul class="return">
|
248
|
+
|
249
|
+
<li>
|
250
|
+
|
251
|
+
|
252
|
+
<span class='type'>(<tt><span class='object_link'><a href="Persistor.html" title="Lims::Core::Persistence::Sequel::Persistor (module)">Persistor</a></span></tt>)</span>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
</li>
|
257
|
+
|
258
|
+
</ul>
|
259
|
+
|
260
|
+
</div><table class="source_code">
|
261
|
+
<tr>
|
262
|
+
<td>
|
263
|
+
<pre class="lines">
|
264
|
+
|
265
|
+
|
266
|
+
50
|
267
|
+
51
|
268
|
+
52
|
269
|
+
53</pre>
|
270
|
+
</td>
|
271
|
+
<td>
|
272
|
+
<pre class="code"><span class="info file"># File 'lib/lims-core/persistence/sequel/filters.rb', line 50</span>
|
273
|
+
|
274
|
+
<span class='kw'>def</span> <span class='id add_comparison_filter'>add_comparison_filter</span><span class='lparen'>(</span><span class='id dataset'>dataset</span><span class='comma'>,</span> <span class='id comparison_criteria'>comparison_criteria</span><span class='rparen'>)</span>
|
275
|
+
<span class='id comparison_persistor'>comparison_persistor</span> <span class='op'>=</span> <span class='id comparison_filter'>comparison_filter</span><span class='lparen'>(</span><span class='id comparison_criteria'>comparison_criteria</span><span class='rparen'>)</span>
|
276
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id class'>class</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id dataset'>dataset</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='id comparison_persistor'>comparison_persistor</span><span class='period'>.</span><span class='id dataset'>dataset</span><span class='comma'>,</span> <span class='symbol'>:id</span> <span class='op'>=></span> <span class='symbol'>:key</span><span class='rparen'>)</span><span class='period'>.</span><span class='id qualify'>qualify</span><span class='rparen'>)</span>
|
277
|
+
<span class='kw'>end</span></pre>
|
278
|
+
</td>
|
279
|
+
</tr>
|
280
|
+
</table>
|
281
|
+
</div>
|
282
|
+
|
283
|
+
<div class="method_details ">
|
284
|
+
<p class="signature " id="comparison_filter-instance_method">
|
285
|
+
|
286
|
+
- (<tt><span class='object_link'><a href="Persistor.html" title="Lims::Core::Persistence::Sequel::Persistor (module)">Persistor</a></span></tt>) <strong>comparison_filter</strong>(criteria)
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
</p><div class="docstring">
|
291
|
+
<div class="discussion">
|
292
|
+
|
293
|
+
<p>Implement a comparison filter for a Sequel::Persistor. Key being the name
|
294
|
+
of the resource's field and the value is a Hash. The key of the hash is a
|
295
|
+
comparison operator and the value is the given value the filter do the
|
296
|
+
comparison against.</p>
|
297
|
+
|
298
|
+
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
<div class="tags">
|
302
|
+
<h3>Parameters:</h3>
|
303
|
+
<ul class="param">
|
304
|
+
|
305
|
+
<li>
|
306
|
+
|
307
|
+
<span class='name'>criteria</span>
|
308
|
+
|
309
|
+
|
310
|
+
<span class='type'>(<tt>Hash<String, <span class='object_link'><a href="../../../../Object.html" title="Object (class)">Object</a></span>></tt>)</span>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</li>
|
315
|
+
|
316
|
+
</ul>
|
317
|
+
|
318
|
+
<h3>Returns:</h3>
|
319
|
+
<ul class="return">
|
320
|
+
|
321
|
+
<li>
|
322
|
+
|
323
|
+
|
324
|
+
<span class='type'>(<tt><span class='object_link'><a href="Persistor.html" title="Lims::Core::Persistence::Sequel::Persistor (module)">Persistor</a></span></tt>)</span>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
</li>
|
329
|
+
|
330
|
+
</ul>
|
331
|
+
|
332
|
+
</div><table class="source_code">
|
333
|
+
<tr>
|
334
|
+
<td>
|
335
|
+
<pre class="lines">
|
336
|
+
|
337
|
+
|
338
|
+
32
|
339
|
+
33
|
340
|
+
34
|
341
|
+
35
|
342
|
+
36
|
343
|
+
37
|
344
|
+
38
|
345
|
+
39
|
346
|
+
40
|
347
|
+
41
|
348
|
+
42
|
349
|
+
43
|
350
|
+
44</pre>
|
351
|
+
</td>
|
352
|
+
<td>
|
353
|
+
<pre class="code"><span class="info file"># File 'lib/lims-core/persistence/sequel/filters.rb', line 32</span>
|
354
|
+
|
355
|
+
<span class='kw'>def</span> <span class='id comparison_filter'>comparison_filter</span><span class='lparen'>(</span><span class='id criteria'>criteria</span><span class='rparen'>)</span>
|
356
|
+
<span class='id clause'>clause</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
357
|
+
<span class='id criteria'>criteria</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id field'>field</span><span class='comma'>,</span> <span class='id comparison_expression'>comparison_expression</span><span class='op'>|</span>
|
358
|
+
<span class='id comparison_expression'>comparison_expression</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id operator'>operator</span><span class='comma'>,</span> <span class='id value'>value</span><span class='op'>|</span>
|
359
|
+
<span class='id raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Not supported comparison operator has been given: '</span><span class='embexpr_beg'>#{</span><span class='id operator'>operator</span><span class='rbrace'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='const'>COMPARISON_OPERATORS</span><span class='period'>.</span><span class='id include?'>include?</span><span class='lparen'>(</span><span class='id operator'>operator</span><span class='rparen'>)</span>
|
360
|
+
|
361
|
+
<span class='id clause'>clause</span> <span class='op'>=</span> <span class='id clause'>clause</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>) & (</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id clause'>clause</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
362
|
+
<span class='id clause'>clause</span> <span class='op'>=</span> <span class='id clause'>clause</span> <span class='op'>+</span> <span class='id field'>field</span> <span class='op'>+</span> <span class='id operator'>operator</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='id value'>value</span><span class='period'>.</span><span class='id to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span>
|
363
|
+
<span class='kw'>end</span>
|
364
|
+
<span class='kw'>end</span>
|
365
|
+
|
366
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id class'>class</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id dataset'>dataset</span><span class='period'>.</span><span class='id where'>where</span><span class='lparen'>(</span><span class='id clause'>clause</span><span class='rparen'>)</span><span class='period'>.</span><span class='id qualify'>qualify</span><span class='rparen'>)</span>
|
367
|
+
<span class='kw'>end</span></pre>
|
368
|
+
</td>
|
369
|
+
</tr>
|
370
|
+
</table>
|
371
|
+
</div>
|
372
|
+
|
373
|
+
<div class="method_details ">
|
374
|
+
<p class="signature " id="multi_criteria_filter-instance_method">
|
375
|
+
|
376
|
+
- (<tt><span class='object_link'><a href="Persistor.html" title="Lims::Core::Persistence::Sequel::Persistor (module)">Persistor</a></span></tt>) <strong>multi_criteria_filter</strong>(criteria)
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
</p><div class="docstring">
|
381
|
+
<div class="discussion">
|
382
|
+
|
383
|
+
<p>Implement a multicriteria filter for a Sequel::Persistor. Value can be
|
384
|
+
either a String, an Array or a Hash. Strings and Arrays are normal
|
385
|
+
filters, whereas Hashes correspond to a joined search. The criteria will
|
386
|
+
apply to the joined object corresponding to the key.</p>
|
387
|
+
|
388
|
+
|
389
|
+
</div>
|
390
|
+
</div>
|
391
|
+
<div class="tags">
|
392
|
+
<h3>Parameters:</h3>
|
393
|
+
<ul class="param">
|
394
|
+
|
395
|
+
<li>
|
396
|
+
|
397
|
+
<span class='name'>Hash<String,</span>
|
398
|
+
|
399
|
+
|
400
|
+
<span class='type'>(<tt>Hash<String, <span class='object_link'><a href="../../../../Object.html" title="Object (class)">Object</a></span> > criteria</tt>)</span>
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
—
|
405
|
+
<div class='inline'>
|
406
|
+
<p>Object > criteria</p>
|
407
|
+
</div>
|
408
|
+
|
409
|
+
</li>
|
410
|
+
|
411
|
+
</ul>
|
412
|
+
|
413
|
+
<h3>Returns:</h3>
|
414
|
+
<ul class="return">
|
415
|
+
|
416
|
+
<li>
|
417
|
+
|
418
|
+
|
419
|
+
<span class='type'>(<tt><span class='object_link'><a href="Persistor.html" title="Lims::Core::Persistence::Sequel::Persistor (module)">Persistor</a></span></tt>)</span>
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
</li>
|
424
|
+
|
425
|
+
</ul>
|
426
|
+
|
427
|
+
</div><table class="source_code">
|
428
|
+
<tr>
|
429
|
+
<td>
|
430
|
+
<pre class="lines">
|
431
|
+
|
432
|
+
|
433
|
+
18
|
434
|
+
19
|
435
|
+
20
|
436
|
+
21
|
437
|
+
22
|
438
|
+
23
|
439
|
+
24</pre>
|
440
|
+
</td>
|
441
|
+
<td>
|
442
|
+
<pre class="code"><span class="info file"># File 'lib/lims-core/persistence/sequel/filters.rb', line 18</span>
|
443
|
+
|
444
|
+
<span class='kw'>def</span> <span class='id multi_criteria_filter'>multi_criteria_filter</span><span class='lparen'>(</span><span class='id criteria'>criteria</span><span class='rparen'>)</span>
|
445
|
+
<span class='comment'># We need to create the adequat dataset.
|
446
|
+
</span> <span class='id dataset'>dataset</span> <span class='op'>=</span> <span class='id __multi_criteria_filter'>__multi_criteria_filter</span><span class='lparen'>(</span><span class='id criteria'>criteria</span><span class='rparen'>)</span><span class='period'>.</span><span class='id dataset'>dataset</span>
|
447
|
+
<span class='comment'># As the dataset can include join, we need to select only the columns
|
448
|
+
</span> <span class='comment'># corresponding to the persistor
|
449
|
+
</span> <span class='kw'>self</span><span class='period'>.</span><span class='id class'>class</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id dataset'>dataset</span><span class='period'>.</span><span class='id qualify'>qualify</span><span class='lparen'>(</span><span class='id table_name'>table_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id distinct'>distinct</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
450
|
+
<span class='kw'>end</span></pre>
|
451
|
+
</td>
|
452
|
+
</tr>
|
453
|
+
</table>
|
454
|
+
</div>
|
455
|
+
|
456
|
+
</div>
|
457
|
+
|
458
|
+
</div>
|
459
|
+
|
460
|
+
|
461
|
+
</body>
|
462
|
+
</html>
|