@@ -135,8 +135,8 @@ public class RubyJdbcConnection extends RubyObject {
135135
136136 protected RubyJdbcConnection (Ruby runtime , RubyClass metaClass ) {
137137 super (runtime , metaClass );
138- attributeClass = runtime .getModule ( "ActiveModel" ). getClass ("Attribute" );
139- timeZoneClass = runtime .getModule ( "ActiveSupport" ). getClass ("TimeWithZone" );
138+ attributeClass = ( RubyClass ) (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveModel" )). getConstant ("Attribute" );
139+ timeZoneClass = ( RubyClass ) (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveSupport" )). getConstant ("TimeWithZone" );
140140 }
141141
142142 private static final ObjectAllocator ALLOCATOR = new ObjectAllocator () {
@@ -157,27 +157,27 @@ public static RubyClass getJdbcConnection(final Ruby runtime) {
157157 }
158158
159159 protected static RubyModule ActiveRecord (ThreadContext context ) {
160- return context .runtime .getModule ("ActiveRecord" );
160+ return ( RubyModule ) context .runtime .getObject (). getConstantAt ("ActiveRecord" );
161161 }
162162
163163 public static RubyClass getBase (final Ruby runtime ) {
164- return (RubyClass ) runtime .getModule ( "ActiveRecord" ).getConstantAt ("Base" );
164+ return (RubyClass ) (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveRecord" ) ).getConstantAt ("Base" );
165165 }
166166
167167 /**
168168 * @param runtime
169169 * @return <code>ActiveRecord::Result</code>
170170 */
171171 public static RubyClass getResult (final Ruby runtime ) {
172- return (RubyClass ) runtime .getModule ( "ActiveRecord" ).getConstantAt ("Result" );
172+ return (RubyClass ) (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveRecord" ) ).getConstantAt ("Result" );
173173 }
174174
175175 /**
176176 * @param runtime
177177 * @return <code>ActiveRecord::ConnectionAdapters</code>
178178 */
179179 public static RubyModule getConnectionAdapters (final Ruby runtime ) {
180- return (RubyModule ) runtime .getModule ( "ActiveRecord" ).getConstantAt ("ConnectionAdapters" );
180+ return (RubyModule ) (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveRecord" ) ).getConstantAt ("ConnectionAdapters" );
181181 }
182182
183183 /**
@@ -202,31 +202,31 @@ protected static RubyClass getForeignKeyDefinition(final Ruby runtime) {
202202 * @return <code>ActiveRecord::JDBCError</code>
203203 */
204204 protected static RubyClass getJDBCError (final Ruby runtime ) {
205- return runtime .getModule ( "ActiveRecord" ).getClass ("JDBCError" );
205+ return (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveRecord" ) ).getClass ("JDBCError" );
206206 }
207207
208208 /**
209209 * @param runtime
210210 * @return <code>ActiveRecord::ConnectionNotEstablished</code>
211211 */
212212 protected static RubyClass getConnectionNotEstablished (final Ruby runtime ) {
213- return runtime .getModule ( "ActiveRecord" ).getClass ("ConnectionNotEstablished" );
213+ return (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveRecord" ) ).getClass ("ConnectionNotEstablished" );
214214 }
215215
216216 /**
217217 * @param runtime
218218 * @return <code>ActiveRecord::NoDatabaseError</code>
219219 */
220220 protected static RubyClass getNoDatabaseError (final Ruby runtime ) {
221- return runtime .getModule ( "ActiveRecord" ).getClass ("NoDatabaseError" );
221+ return (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveRecord" ) ).getClass ("NoDatabaseError" );
222222 }
223223
224224 /**
225225 * @param runtime
226226 * @return <code>ActiveRecord::TransactionIsolationError</code>
227227 */
228228 protected static RubyClass getTransactionIsolationError (final Ruby runtime ) {
229- return (RubyClass ) runtime .getModule ( "ActiveRecord" ).getConstant ("TransactionIsolationError" );
229+ return (RubyClass ) (( RubyModule ) runtime .getObject (). getConstantAt ( "ActiveRecord" ) ).getConstant ("TransactionIsolationError" );
230230 }
231231
232232 @ JRubyMethod (name = "transaction_isolation" , alias = "get_transaction_isolation" )
@@ -2734,7 +2734,7 @@ else if ( value instanceof RubyNumeric ) {
27342734 else { // e.g. `BigDecimal '42.00000000000000000001'`
27352735 Ruby runtime = context .runtime ;
27362736 statement .setBigDecimal (index ,
2737- RubyBigDecimal .newInstance (context , runtime .getModule ("BigDecimal" ), value , RubyFixnum .zero (runtime )).getValue ());
2737+ RubyBigDecimal .newInstance (context , ( RubyModule ) runtime .getObject (). getConstantAt ("BigDecimal" ), value , RubyFixnum .zero (runtime )).getValue ());
27382738 }
27392739 }
27402740
0 commit comments