Displaying 20 results from an estimated 600 matches similar to: "DRY a named scope"
2009 Jul 23
11
Problem with named_scope
Here are my scopes:
default_scope :order => ''posted_on DESC'', :conditions => { :status =>
''visible'' }
named_scope :positive, :conditions => { :rating => ''positive'', :status
=> ''visible'' }
named_scope :neutral, :conditions => { :rating => ''neutral'', :status
=>
2012 Jan 05
1
Re old message CPQPOWER-MIB - nearly there (using snmp-ups with HP AH401A management card)
Hi,
This appears to be related to a thread from January 2010:
http://lists.alioth.debian.org/pipermail/nut-upsdev/2010-January/004470.html
NB: This is on an HP-UX 11.31 box, using a self compiled and packaged version of NUT 2.6.3, and net-snmp v5.7.1.
Therefore some of the search paths and things like that may well be wrong because I've done something dumb. I'm also
only just getting
2010 Sep 01
4
deprecation warning in Rails 3 about Base.named_scope
I recently upgraded to Rails 3, and this error has come up
ubiquitously:
DEPRECATION WARNING: Base.named_scope has been deprecated, please use
Base.scope instead.
Any ideas on how to get rid of it? Or should I just wait for
something?
There''s actually no place in my application where the code
"Base.named_scope" exists, so I assume the problem is inherent in gems
that
2014 Feb 07
3
Tripplite UPS (SU10KRT3/1X) through snmp-ups (nut 2.6.5)
Hi, Nut-upsusers,
I am having problem configuring NUT to work with Tripplite UPS through SNMP.
There is a Tripplite SmartOnline SU10KRT3/1X and attempts to monitor it
using NUT though SNMP are failing...
OS: Enterprise Linux 6, Nut version: 2.6.5.
ups.conf is configured:
[trippliteups]
driver = snmp-ups
port = 10.200.254.39
desc = "ProductionServer"
2014 Feb 24
2
Arch Linux and Tripp Lite web snmp card issues.
I have been working with NUT to get this working since upgrading to a
web snmp card in a UPS. I keep getting seg faults when running snmp-ups
also. Below is the output.
kernel: [1365065.178230] snmp-ups[1940]: segfault at 0 ip b7555470 sp
bf8d89e8 error 4 in libc-2.18.so[b74c2000+1a9000]
Running: Arch i686 current
Nut is current git
Device is Tripp Lite SU2200XLa with WEBSNMPCARD running
2009 May 12
4
has_many :through and scopes: how to mutate the set of associated objects?
I have a model layer containing Movie, Person, Role, and RoleType,
making it possible to express facts such as "Clint Easterbunny is
director of the movie Gran Milano".
The relevant model and associations look like this
class Movie < ActiveRecord::Base
has_many :roles, :include => :role_type, :dependent => :destroy
has_many :participants, :through => :roles, :source
2010 Jan 15
1
Chaining queries in ActiveRecord
Hi all,
Stuck at this problem for several days. Tried to use named_scope,
scope_out, and plugin such as searchlogic, but no result.
The problem is as follows: I have a pic table and tag table, and a
join table called pic_tag (with only pic_id and tag_id) so that I can
associate N pics to M tags. This is the tutorial way to set up a many-
to-many association. I''m trying to implement a
2015 Oct 26
1
snmp-ups ApplicationError / APPCRASH
Hi List,
i've installed the network ups tool on one of my windows machine (server
2012 r2).
My ups is an APC Back-UPS Pro 550 which is connected via USB to an Synology
Diskstation DS414.
I found this video https://www.youtube.com/watch?v=0l54n_37M_k
My config:
*nut.conf*
MODE=standalone
*ups.conf*
[ups]
driver = snmp-ups
port = 192.168.2.5
community = public
*upsd.users*
[monuser]
2010 Apr 07
3
Recommendation for searching with regards to timestamp & foreign key attributes
hi guys,
I need a recommendation for searching with regards to timestamp &
foreign key attributes. Sounds
a bit too much but here''s an example.
Suppose we have a "blog" object. It has many attributes such as
- title
- content
- status_id
- created_at
- updated_at
There are also "status" objects which have the following statuses,
"new",
2024 Nov 19
1
New UPS ABB
Hi Team
While i;m searching on the internet about UPS SNMP monitoring , I found
this NUT server. Thank God, But sad news is that my UPS is not listed in
the compatibility list.
But I download NUT server on my ubuntu node and just discover it
sudo /lib/nut/snmp-ups -DD -a ups
unfortunately got the below error message.
228.253598 [D2] Testing ups.model using OID 1.3.6.1.2.1.33.1.1.2.0
2009 Jul 11
2
offeride :limit named_scope default_scope
Hi,
Rails 2.3.2
class TestD < ActiveRecord::Base
default_scope :limit => 12
named_scope :limit, lambda { |num| { :limit => num} }
end
ruby script/console
>> TestD.all
TestD Load (0.7ms) SELECT * FROM "test_ds" LIMIT 12
=> []
>> TestD.limit(14)
TestD Load (0.3ms) SELECT * FROM "test_ds" LIMIT 12
=> []
Any ideas why the default limit
2015 Oct 12
2
APC Back-UPS ES 650 connected to a Synology DS411slim
All,
I recently connected my UPS to my NAS. The NAS detected the UPS, and I
checked the "Enable network UPS server" option and added relevant IPs to
the "Permitted DiskStation devices" option. The NAS is running DSM 5.2-5592
Update 4, with a NUT version of SDS5-2-2015Q1branch-5579-15061. I then
attempted to connect my desktop via SNMP. My desktop is running Arch Linux,
with a
2023 Feb 16
1
No matching MIB found for sysOID
Hello all,
Thank you in advance for a great FOSS project. Also, thank you for reading my question.
I have a CyberPower OR1500LCDRTXL2U with an RMCARD205. There are a handful of devices plugged into the UPS.
I received a message today saying to send upsc output to NUT developers after this message: "No matching MIB found for sysOID '.1.3.6.1.4.1.3808.1.1.1'"
root at
2014 Feb 25
2
Arch Linux and Tripp Lite web snmp card issues.
Thanks for the quick response Charles! I may not have gotten the correct
output from the snmpwalk, let me know if the attachment is usable. Thanks!
New data added, here is the gdb output:
Reading symbols from /usr/bin/snmp-ups...(no debugging symbols
found)...done.
(gdb) run -a tripplite -DD
Starting program: /usr/bin/snmp-ups -a tripplite -DD
warning: Could not load shared library symbols for
2008 May 22
14
Specifying certain tables NOT to be cleared each example?
Is it possible to specify that certain tables not be cleared on each
example.
I''ve inherited a project where a good amount of enumerated data is
stored in the database (US States, statuses, about 15-20 tables worth.
Over all, it''s a reasonable decision that leads to solid production
code (acts_as_enumerated is good). This data is read-only and
relatively static; any
2008 May 13
6
Testing that named_scope is defined
Hi guys,
I''m just beginning to use RSpec and I ran into the issue of testing a
named_scope. I''m not actually trying to test its behavior, as it''s not
my code, but I wanted to test at least that it''s defined. I tried
doing this:
describe Post, ".most_recent" do
it "should be defined" do
Post.method_defined?(:most_recent).should be_true
2011 Sep 05
3
Scheduling 2.6.2 release (was: on Ubuntu Developer Summit (Oneiric), NUT and 2.8.0)
Hey,
I'm scheduling a 2.6.2 release for max. September 15.
The content will be lighter than first expected with 2.8.0 (see below).
This includes the current trunk plus:
- merge the nut-scanner branch,
- some snmp-ups improvements (sysOID matching for init stage) and some more
MIBs,
- a first complete version of the nut-ipmipsu driver,
- the new jNut Java binding,
- preliminary support of
2009 Nov 01
1
please help - complicated polymorphic association
I am trying to build a shared-appointment system, where users can
subscribe to appointments and be updated whenever changes are made to
them. I have three objects in this system, appointments, users, and
subscribers. Subscribers are a polymorphic object like so:
class Subscriber < ActiveRecord::Base
belongs_to :user
belongs_to :subscribable, :polymorphic => true
end
The tricky part is
2010 Jun 26
4
Time-dependent values/constants in Models: An issue or not?
Hi there,
I remember reading in the comments of a Rails blog something along these
lines:
"Since a Model is loaded only once in production development (at server
start), certain time-dependent ''constants'' that you have placed in a
method of a Model will always return the same value for those
''constants'', i.e. the value the ''constant'' had
2017 Jun 10
4
SNMP Stuff/MIBs for CyberPower and APC UPSs
Build from source, and done . . . wasting your time looking for a less out of date RPM is pointless. . . RPM, .deb, etc are almost always downrev. . .
- Tim
On June 10, 2017 2:06:42 PM CDT, Ben Kamen <ben at benkamen.net> wrote:
>Hey all,
>
> I recently got an RMCARD205 for my Cyber UPS....
>
>if I use no MIBS line in the config file, I get this:
>
>
>> Network