ActiveLdap::DynamicFinders
Dynamic finders for ActiveLdap
Installation
Add this line to your application's Gemfile:
gem 'active_ldap-dynamic_finders'
And then execute:
$ bundle
Or install it yourself as:
$ gem install active_ldap-dynamic_finders
Usage
Add it to your ActiveLdap model:
class User < ActiveLdap::Base
include ActiveLdap::DynamicFinders # <- Add this line
...
end
Then you have .find_by_*
and .find_by_*_and_*
methods. Replace * with any attribute available in your ActiveDirectory
User.find_by_cn('jim')
User.find_by_cn_and_mail('jim', 'jim@example.com')
License
ActiveLdap::DynamicFinders is released under the MIT License.
Copyright © 2013-2014 Christian Nennemann (christian.nennemann[at]gmail[dot]com)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.